Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Using namespace issue?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
pwc Posted - Dec 09 2010 : 1:23:01 PM
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;
7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 13 2010 : 1:51:17 PM
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.
pwc Posted - Dec 10 2010 : 7:04:02 PM
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.
feline Posted - Dec 10 2010 : 6:46:26 PM
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".
pwc Posted - Dec 10 2010 : 6:20:19 PM
Strangely, I get suggestions from a class called xxxx::ch_map for both tests (xxxx is another namespace).
feline Posted - Dec 10 2010 : 6:13:37 PM
A little unexpected.

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

map<int, int>::
intProps.

Any listboxes at all?
pwc Posted - Dec 10 2010 : 12:25:11 PM
Alt-G takes me to the "using std::map;" line. Likewise, the definition field shows "using std.map"
feline Posted - Dec 09 2010 : 10:01:53 PM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000