Annoying debug probelm in Visual Studio

Started by
7 comments, last by maya18222 14 years, 5 months ago
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
Advertisement
Are you debugging the debug build or the release build?
Its definatly the Debug Build, im just wondering if maybe ive flicked something in the settings that i shouldnt have
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.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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.
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.
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
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}

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

This topic is closed to new replies.

Advertisement