Annoying debug probelm in Visual Studio

This topic is 3156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

For some reason, when stepping through my code, a large number of variables dont seem to show up under autos or locals. And when i add them to the watched window, i get:- CXX0017: Error: symbol "NameOfVariable" not found And these are varibles, being used in the lines of code im stepping through. Any ideas? Ive tried multiple rebuilds, and deleting files such as the .ncb, .user, and the temporary release/debug folders containing the compiled object files, so that complete rebuilds are carried out, but still no luck

Share on other sites
Are you debugging the debug build or the release build?

Share on other sites
Its definatly the Debug Build, im just wondering if maybe ive flicked something in the settings that i shouldnt have

Share on other sites
Are those variables in a namespace at all? I've had huge amounts of trouble getting the VS debugger to look into namespaces for symbols.

Share on other sites
Nope, not in a namespace. I will try to start a new project, I'd rather know what the problem was though so i can fix it if it happens again.

Share on other sites
This is a long shot, but is it possible that you don't have the right settings for generating the debug information? I.e., right-click on your project, go to Properties.

Under Configuration Properties > C/C++ > General, check your Debug Information Format and make sure it's Program Database for Edit & Continue (/ZI)

Under the Optimization tab, make sure optimization is set to Disabled (/Od)

Under Linker > Debugging, make sure Generate Debug Info is set to Yes (/DEBUG) and make note of the pdb file under Generate Program Database File in case you need that info later on.

You probably already have this covered, I just though it'd be worth mentioning just in case.

Share on other sites
Hi,

I had all that set correctly, but thanks anyway. Ive also noticed that most of the variables that dont work are static, and if i remove the static attribute then they show up in debug.

I still dont know why this is happening, and im having uncomment out the "static" attribute when debugging, which works for some case, but obvioulsy messes things up in others.

I also started a brand new project, and get the same results.

Im using VS 2008 by the way, if that helps

Share on other sites
Static means different things depending on where it's used. Which one is it?

class foo{  static int one; // #1 watch as "foo::one"};static int two; // #2 watch as "two", but only when you're in this filevoid bar(){  static int three; // #3 watch as "three", but only when you're in this function}

Share on other sites
Its a static variable in a function, and im in that function when im trying to watch it.

• 35
• 12
• 10
• 9
• 9
• Forum Statistics

• Total Topics
631358
• Total Posts
2999530
×