473,414 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

std::map problem with VS 7.1

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,st d::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,st d::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
Jul 22 '05 #1
7 1406
Gernot Frisch wrote:
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"?

--
Regards,
Buster.
Jul 22 '05 #2

"Buster" <no***@nowhere.com> schrieb im Newsbeitrag
news:ca**********@newsg4.svr.pol.co.uk...
Gernot Frisch wrote:
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"?

--
Regards,
Buster.


Sorry.

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

vecstringmap reference;

-Gernot
Jul 22 '05 #3
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.

--
Regards,
Buster.
Jul 22 '05 #4

"Gernot Frisch" <Me@Privacy.net> wrote in message
news:2j*************@uni-berlin.de...

"Buster" <no***@nowhere.com> schrieb im Newsbeitrag
news:ca**********@newsg4.svr.pol.co.uk...
Gernot Frisch wrote:
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"?

--
Regards,
Buster.


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
Jul 22 '05 #5
>
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
Jul 22 '05 #6
Look at this thread:

http://groups.google.nl/groups?hl=nl...3DN%26tab%3Dwg

I just had the same (or a very similar) problem, and the answer was
there.
It's related to the definition of DEBUG_NEW before inclusion of xtree.
Another big thumbs up for MicroSoft's STL implementation.

Theo
Jul 22 '05 #7

"Theo Vosse" <th*******@yahoo.com> schrieb im Newsbeitrag
news:24**************************@posting.google.c om...
Look at this thread:

http://groups.google.nl/groups?hl=nl...3DN%26tab%3Dwg
I just had the same (or a very similar) problem, and the answer was
there.
It's related to the definition of DEBUG_NEW before inclusion of xtree. Another big thumbs up for MicroSoft's STL implementation.

Theo


Heureka, that was it. Thank you.
-Gernot
Jul 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Duane Hebert | last post by:
2 questions: Given a map defined as std::map<int,string> stringmap; //How do you access the data_type (string) via an iterator? std::string spoo("doh");
3
by: Woodster | last post by:
I have declared the following std::map<std::string, std::string> myMap; to pass myMap to functions should I be declaring functions as: void function(std::map<std::string, std::string>); ...
1
by: Antti Granqvist | last post by:
Hello! I have following object relations: Competition 1--* Category 1--* Course 1 | | * Course
2
by: Serengeti | last post by:
Hello, in my class I have a map that translates strings to pointers to some member functions. The code goes like this: class F { typedef void (Function::*MathFuncPtr)(); std::map<std::string,...
1
by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
19
by: Erik Wikström | last post by:
First of all, forgive me if this is the wrong place to ask this question, if it's a stupid question (it's my second week with C++), or if this is answered some place else (I've searched but not...
3
by: Dan Trowbridge | last post by:
Hi everyone, In my attempt to port code from VS 6.0 to VS.NET I had some code break along the way, mostly due to not adhereing closely to the C++ standard. This may be another instance but I...
1
by: Avery Fong | last post by:
The following program will result in a compile error when building under Debug but will compile under Release. Why does is work under Release mode but not under Debug This program is developed...
13
by: kamaraj80 | last post by:
Hi I am using the std:: map as following. typedef struct _SeatRowCols { long nSeatRow; unsigned char ucSeatLetter; }SeatRowCols; typedef struct _NetData
8
by: mveygman | last post by:
Hi, I am writing code that is using std::map and having a bit of an issue with its performance. It appears that the std::map is significantly slower searching for an element then a sequential...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.