Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Using namespace issue?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pwc
Tomato Guru

138 Posts

Posted - Dec 09 2010 :  1:23:01 PM  Show Profile  Reply with Quote
Hello,

In my solution, the following code is giving me false 'undefined symbol' underlines:


#include <map>

using std::map;

class CSimProps {
public:
    bool GetIntProperty(int propType, int& prop) const
	{
		map<int, int>::const_iterator iter;
		iter = intProps.find(propType);
		bool foundProp = (iter != intProps.end());
		if(foundProp)
			prop = iter->second;
		return foundProp;
	}
private:
	map<int, int> intProps;
};


If I copy/paste this code is a new, blank solution - it works. In my solution, I have to supply 'std::' in front of map<> to make it work. I tried rebuilding my symbol database with no luck. Any tips on how to debug this in the context of my solution? My solution is quite large (100+projects, MLOCs++).

My info:


VA_X.dll file version 10.6.1836.0 built 2010.11.10
DevEnv.exe version 9.0.30729.1 Professional
msenv.dll version 9.0.30729.1
Font: Courier New 13(Pixels)
Comctl32.dll version 6.10.7600.16661
Windows 7 6.1 Build 7600
8 processors (x86-64;
WOW64)

Platform: Win32
Stable Includes:
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;

Other Includes:

Stable Source Directories:
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\crt\\src;

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Dec 09 2010 :  10:01:53 PM  Show Profile  Reply with Quote
When you are seeing the problem, if you place the caret into "map" what is shown in VA'c Context and Definition fields?

Where, if anywhere, does VA's Alt-G take you?

It sounds like VA's parser has found a second symbol called "map", hopefully Alt-G or Context and Definition fields will give us a clue about this other map, and its location.

zen is the art of being at one with the two'ness
Go to Top of Page

pwc
Tomato Guru

138 Posts

Posted - Dec 10 2010 :  12:25:11 PM  Show Profile  Reply with Quote
Alt-G takes me to the "using std::map;" line. Likewise, the definition field shows "using std.map"
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Dec 10 2010 :  6:13:37 PM  Show Profile  Reply with Quote
A little unexpected.

What, if anything, is suggested when you type the lines:

map<int, int>::
intProps.

Any listboxes at all?

zen is the art of being at one with the two'ness
Go to Top of Page

pwc
Tomato Guru

138 Posts

Posted - Dec 10 2010 :  6:20:19 PM  Show Profile  Reply with Quote
Strangely, I get suggestions from a class called xxxx::ch_map for both tests (xxxx is another namespace).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Dec 10 2010 :  6:46:26 PM  Show Profile  Reply with Quote
At least some form of progress, but why is VA confusing "map" with "ch_map"? The namespaces might be confusing VA, this does happen occasionally, but the class names are different.

Where does alt-g on "intProps" take you? I assume the correct line, but do further alt-g calls ever take you to some form of "ch_map" line?

Is "ch_map" a widely used class? I am wondering if you can scan through the references to this class, and see if any code jumps out to explain this confusion.

#define map ch_map

would be a good example of a confusing line, but I doubt we will be that "lucky".

zen is the art of being at one with the two'ness
Go to Top of Page

pwc
Tomato Guru

138 Posts

Posted - Dec 10 2010 :  7:04:02 PM  Show Profile  Reply with Quote
alt-g on 'intProps' takes to the correct definition.

I don't see any #defines or typedef of ch_map to map, but I'll keep looking.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Dec 13 2010 :  1:51:17 PM  Show Profile  Reply with Quote
If you add a new, blank .cpp file to your solution, and then copy / paste in just the code from this thread, do you still see the problem?

I am wondering if the problem is related to one of the standard #include files in your solution, or something about the solution its self.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000