468,512 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

How to debug C++ code in Visual Studio 2005

2
Hi,
It should be noticed, I'm not a proff. programmer. I wrote in C++, Pascal, mapple, matlab time by time.
I want to test and debug one math algorithm, so I created new project for it.
Then in the Source file folder I created new cpp file, wrote the code, built the solution. There are no mistakes in code, but when I put some breakpoints to look into variables' values and started debugging, the error have appeared: "No debugging information.Debugging information for 'devenv.eve' connot be found or does not match."
I searched in different forums, but couldn't find any helpful information.
I read the VS help, checked configuration manager (configuration: debug, platform:win32, build:yes), tried again - no result.
1) What should I do to be able to debug simple C++ project?
2) is there any possibility to compile and debug just one file without creating any projects?
3) when and where can I see the results of program's work?
I put some "cout" in the program, but the output window is empty after building the project.

I wil be VERY grateful for any structured advices and references to related forums, articles etc.
Mar 24 '08 #1
2 6513
weaknessforcats
9,207 Expert Mod 8TB
You need to be certain that you are doing a debug build and that all of your libraries are debug libraries.

A debug build places code in the .exe to support the debugger. There are also worker files in the /debug folder of your project to support this also.

If you have a release build, this code is absent and you get the message you describe.

Note: a debug build does not mean defining the prepeocessor _DEBUG symbol.
Mar 24 '08 #2
stand
2
You need to be certain that you are doing a debug build and that all of your libraries are debug libraries.

A debug build places code in the .exe to support the debugger. There are also worker files in the /debug folder of your project to support this also.

If you have a release build, this code is absent and you get the message you describe.

Note: a debug build does not mean defining the prepeocessor _DEBUG symbol.
Thank you for responce. That problem disappeared by itself.
But I have new one. The same issue - I can't debug the code. Here is the description:

I created an empty project "ConsoleApp6". Added a ConsoleApp6.cpp.
Typed the following code:

#include <stdio.h>

int main() {
printf ("Hello!\n");
return 0;
}

Solution is built successfully.
Folders
./ConsolApp6/ConsolApp6/
./ConsolApp6/ConsolApp6/Debug
are created and contain BuildLog.html and etc.
Running ConsoleApp6.exe works as well.
However when I start debugging I see the error message:
"Debugging information for "ConsoleApp6.exe" cannot be found or does not match. Binary was not built with debug information.
do you want to continue debugging?"
After choosing Yes I see in the output:
"'ConsoleApp6.exe': Loaded 'E:\Visual Studio 2005\Projects\ConsoleApp6\debug\ConsoleApp6.exe', Binary was not built with debug information.
'ConsoleApp6.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'ConsoleApp6.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'ConsoleApp6.exe': Loaded 'D:\Program Files\Common Files\LogiShrd\LVMVFM\LVPrcInj.dll', No symbols loaded.
'ConsoleApp6.exe': Loaded 'D:\WINDOWS\system32\user32.dll', No symbols loaded.
'ConsoleApp6.exe': Loaded 'D:\WINDOWS\system32\gdi32.dll', No symbols loaded.
The thread 'Win32 Thread' (0x4d4) has exited with code 8388608 (0x800000).
The program '[852] ConsoleApp6.exe: Native' has exited with code 0 (0x0).
"
I tried to create WinConsoleApp using template, tried to restart Visual Studio, restart my computer, nothing helps.
What is the problem?
Nov 19 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Steve Le Monnier | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.