Visual Studio 2012 hello world C ++

Just installed a trial version of visual studio 2012 (boring and gray!).

But after starting the "empty" C ++ console project and add one source file with this code:

#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; } 

I get the following errors:

'Project3.exe' (Win32): Loaded 'C: \ Users \ baobei \ Documents \ Visual Studio 2012 \ Projects \ Project3 \ Debug \ Project3.exe'. Symbols loaded. "Project3.exe" (Win32): loaded "C: \ Windows \ SysWOW64 \ ntdll.dll". Cannot find or open the PDB file. "Project3.exe" (Win32): loaded "C: \ Windows \ SysWOW64 \ kernel32.dll". Cannot find or open the PDB file. "Project3.exe" (Win32): loaded "C: \ Windows \ SysWOW64 \ KernelBase.dll". Cannot find or open the PDB file. "Project3.exe" (Win32): loaded "C: \ Windows \ SysWOW64 \ msvcp110d.dll". Symbols loaded. "Project3.exe" (Win32): loaded "C: \ Windows \ SysWOW64 \ msvcr110d.dll". Symbols loaded. The program '[6932] Project3.exe' exited with code 0 (0x0).

What am I doing wrong? Thanks for the advice.

+4
source share
1 answer

I don’t think you are doing something wrong. The program '[6932] Project3.exe' has exited with code 0 (0x0). indicates that your program is running - try returning something other than 0 from main() , then you will see a different exit code.

I think your problem is that the output console closes immediately, so you have no way to see the result. See How to open a console window in Visual C ++? for some solutions.

+4
source

Source: https://habr.com/ru/post/1443158/


All Articles