I have seen this question asked several times and I have tried all the nonsense that I have read, but I can't make it work.
I use Visual Studio 2012, in Debug mode. I compile the simple code
#include<iostream>
int main()
{
std::cout << "Hi" << std::endl;
system("pause");
return 0;
}
I put a break-point in line 4 (std::cout...) and I press F5 to execute.
The break-point is ignored and there is an exclamation mark next to it saying that "The breakpoint will not currently be hit. No symbols have been loaded for this document".
EDIT: In the output window after building I get a warning:
main.obj : warning LNK4099: PDB 'vc110.pdb' was not found with 'main.obj' or at 'Z:\Projects\Tools\DebugTest\Debug\vc110.pdb'; linking object as if no debug info DebugTest.vcxproj -> Z:\Projects\Tools\DebugTest\Debug\DebugTest.exe
However, if I go to Properties > Configuration Properties > Linker > Debugging, in "Generate Program Database file" I believe I have the correct "$(OutDir)$(TargetName).pdb" so I don't understand why the pdb file is not being created.