std::map problem with VS 7.1

G

Gernot Frisch

typedef vector<string> vecstring;

string key = pC;
string ref = linkhtml;
vecstring vs;
vs.push_back(ref);
reference[key]=vs; // this line causes an error:


Visual Studio .NET 2003\Vc7\include\xtree(1133) : error C2061: Syntax
error: Bezeichner '_Wherenode'
d:\Programme\Microsoft Visual Studio .NET
2003\Vc7\include\xtree(1130): Bei der Kompilierung der Memberfunktion
'std::_Tree<_Traits>::_Nodeptr
std::_Tree<_Traits>::_Buynode(std::_Tree<_Traits>::_Nodeptr,std::_Tree
<_Traits>::_Nodeptr,std::_Tree<_Traits>::_Nodeptr,const
std::_Tree<_Traits>::value_type &,char)' der Klassenvorlage
with
[

_Traits=std::_Tmap_traits<std::string,vecstring,std::less<std::string>
,std::allocator<std::pair<const std::string,vecstring>>,false>
]
d:\Programme\Microsoft Visual Studio .NET
2003\Vc7\include\map(77): Siehe Verweis auf Instanziierung der
kompilierten Klassenvorlage 'std::_Tree<_Traits>'
with
[

_Traits=std::_Tmap_traits<std::string,vecstring,std::less<std::string>
,std::allocator<std::pair<const std::string,vecstring>>,false>
]
e:\GeFr\Fun\BibleXML\BibleXML.cpp(106): Siehe Verweis auf
Instanziierung der kompilierten Klassenvorlage 'std::map<_Kty,_Ty>'
with
[
_Kty=std::string,
_Ty=vecstring
]


Please help.

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
 
B

Buster

Gernot said:
typedef vector<string> vecstring;

string key = pC;
string ref = linkhtml;
vecstring vs;
vs.push_back(ref);
reference[key]=vs; // this line causes an error:

Please post the real code. All the lines would cause errors if
I tried to compile that. What type is "reference"?
 
G

Gernot Frisch

Buster said:
Gernot said:
typedef vector<string> vecstring;

string key = pC;
string ref = linkhtml;
vecstring vs;
vs.push_back(ref);
reference[key]=vs; // this line causes an error:

Please post the real code. All the lines would cause errors if
I tried to compile that. What type is "reference"?

Sorry.

using namespace std;
typedef vector<string> vecstring;
typedef map<string, vecstring> vecstringmap;

vecstringmap reference;

-Gernot
 
B

Buster

Please, post a complete sample that can be compiled correctly (except
for the error you described, of course). What you have so far seems to
be correct. Those error messages are no help to me. If I had the source
I could get messages in a language I understand.
 
J

John Harrison

Gernot Frisch said:
Buster said:
Gernot said:
typedef vector<string> vecstring;

string key = pC;
string ref = linkhtml;
vecstring vs;
vs.push_back(ref);
reference[key]=vs; // this line causes an error:

Please post the real code. All the lines would cause errors if
I tried to compile that. What type is "reference"?

Sorry.

using namespace std;
typedef vector<string> vecstring;
typedef map<string, vecstring> vecstringmap;

vecstringmap reference;

-Gernot

This code compiles for me (VS 7.1)

#include <string>
#include <map>
#include <vector>

using namespace std;

typedef vector<string> vecstring;
typedef map<string, vecstring> vecstringmap;

vecstringmap reference;

int main() {
string key = "abc";
string ref = "123";
vecstring vs;
vs.push_back(ref);
reference[key]=vs;
}

For reasons that shouldn't need repeating (but they do) it is always best to
post complete programs. Whatever the problem is, it might well be in code
you didn't post.

john
 
J

John Harrison

For reasons that shouldn't need repeating (but they do) it is always best to
post complete programs. Whatever the problem is, it might well be in code
you didn't post.

PS I looked at the line that is in your error message and there is no syntax
error on it, perhaps some macro is interfering with the standard C++ header
files.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top