I’m a Java guy (I know a fair amount of C) who is trying to edge my way into C++.
Currently I am using VisualStudio 2012 Express and have created an empty project. with the following…
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
Seriously couldn’t get any easier. Yet, I cannot get the damn output to show up for my life.
'Spark.exe' (Win32): Loaded 'C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Debug\Spark.exe'. Symbols loaded.
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
SHIMVIEW: ShimInfo(Complete)
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded.
'Spark.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
The program '[6260] Spark.exe' has exited with code 0 (0x0).
After reading into this, it appears that creating an empty project disables the console that I’ve used to having in the simple C project I did in college.
So what are some deadly simple ways of getting basic debug text like printf, cout and cerr into either VS (preferred) or a console when debug mode is active?
Thanks!
To see text in the Windows IDE output you use
OutputDebugString().See http://msdn.microsoft.com/en-us/library/windows/desktop/aa363362%28v=vs.85%29.aspx
Otherwise it goes to the console (see your settings if you want a console, but know that it will close as soon as your program exits, to prevent such use something like
getchar()to pause until you hit enter.)Better, to my point of view, switch to Linux…