Jump to content
  • Advertisement
Sign in to follow this  
maya18222

Annoying debug probelm in Visual Studio

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 file
void bar()
{
static int three; // #3 watch as "three", but only when you're in this function
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!