Sorry, if it is a kind of a terrible advise - please be sure that you see Debug Win32 configuration.
If it is, you can check the project settings - it should be _DEBUG in the Preprocessor Definitions.
Hi,
I am calling a function from main() and inside this function I have defined local variables.
I am using the debugging mode. (step by step pressing F10)
I can't see the value of the variables, not by quick watch, not by add watch.
e.g.
int line_number;
line_number=get_value();
cout<<line_number;
I see in the watch window:
CXX017 : ERROR : symbol "line_number" not found.
any suggestions?
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You don't show the code so this is really an advisory rather than an answer... if the function is inline you may not be able to view the symbols it contains in the debugger. Under some circumstances (but not all oddly enough) the symbols are not available.
As I said before, this is just something for you to be aware of and is not intended as an answer to your problem (I'd suggest the real problem has already been identified by pgnatyuk).
I can see Debug and Win32 in the main screen of the debugger (I am using Vista 64 bit)
In the Project-> C/C++ -> Preprocessor ->Preprocessor definitions : WIN32,NDEBUG,_CONSOLE
there is no option for choosing _DEBUG
Is there a different setting for vista 64?
I copied the cpp files to another dir and it seems to be working OK. (I can see the values of variables inside functions while debugging)
I am still checking it with bigger input files.
How can I compare the project settings between the 2 folders?
>> there is no option for choosing _DEBUG
That doesn't control the symbols. the important thing is the code isn't being optimized and symbols are being generated (I'm at home without VC so I can't check what those are, but rest assured it is not controlled by preprocesser settings).
>> How can I compare the project settings between the 2 folders?
http://winmerge.org/
you can replace just manually NDEBUG for _DEBUG. Probably it will be not enough. If the problem will still exists you will have to check other project settings beginning from the optimization as evilrix said - there is a page in project settings where you will find the optimization parameter - it should be "Disable". Please clear/re-build solution before the test.
>> I can see Debug and Win32 in the main screen of the debugger (I am using Vista 64 bit)
>> In the Project-> C/C++ -> Preprocessor ->Preprocessor definitions : WIN32,NDEBUG,_CONSOLE
Actually, I just look at that again and I realized something is wrong. NDEBUG should only be defined in a release build so if you are saying it's defined in debug then I'd say your project settings are probably mixed up some how. I doubt very much that just changing NDEBUG to _DEBUG will fix all your issues.
Thanks
I do see that in the new project has the _DEBUG value for the preprocessor.
I will copy the cpp files to the new project and work there until I am able to understand what is the problem in the old one.
Is it OK to work with Debug Win32 setting when I am using vista 64 bit?
How can I know that there are no more setting problems in my project?
Thanks!
I thought you don't need to copy all source files to the new project. Just open 2 Visual Studio's, open the debug configuration, and item after item verify all settings in the DEBUG configuration.
I also use vista. It works. There are specific settings, but, I think, no it does not matter.
It is nice if you can create new projects and copy all source file, restore all resources, etc. But I don't know how big is your project. So we can try to fix the existing project. But you decide.
>> Is it OK to work with Debug Win32 setting when I am using vista 64 bit?
Yes, it's built 32 bit binaries, which will still run on Win64 (all be it in 32 bit mode)
>> How can I know that there are no more setting problems in my project?
Well, NDEBUG should NEVER exist in a debug built so I'd question how it got there. Without having access to the project I could only guess on other issues. I would create a new project and migrate the files over to it... keep the old one for reference just in case.
Business Accounts
Answer for Membership
by: masheikPosted on 2009-07-20 at 22:47:04ID: 24901505
select the variable want to watch and right click in popup menu u see a opiton addto watch click that..
can you try disabling the optimize code option in the project and file properties or try add namespace into the file?