473,656 Members | 2,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LNK2005, using #include <vector> and <map>

"Hello World\n",

i have the following problem:
One of my headerfiles for a lib is including <vector>.
When i compile the lib, everything is done well.
In my application another file is including <map>.
By linking my application and the lib, following errors occur:

error LNK2005: "public: __thiscall std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char>
::~basic_strin g<char,struct std::char_trait s<char>,class std::allocator< char> >(void)"
(??1?$basic_str ing@DU?$char_tr aits@D@std@@V?$ allocator@D@2@@ std@@QAE@XZ)
bereits in Engine.lib(Wate rBox.obj) definiert
error LNK2005: "public: __thiscall std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char>::basic_string <char,struct std::char_trait s<char>,class std::allocator< char> >(char const *)"
(??0?$basic_str ing@DU?$char_tr aits@D@std@@V?$ allocator@D@2@@ std@@QAE@PBD@Z)
bereits in Engine.lib(Wate rBox.obj) definiert
error LNK2005: "public: __thiscall std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char>::basic_string <char,struct std::char_trait s<char>,class

std::allocator< char> >(class std::basic_stri ng<char,struct
std::char_trait s<char>,class std::allocator< char> > const &)"
(??0?$basic_str ing@DU?$char_tr aits@D@std@@V?$ allocator@D@2@@ std@@QAE@ABV01@ @Z)
bereits in Engine.lib(Wate rBox.obj) definiert
error LNK2005: "public: char const * __thiscall
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> >::c_str(void)c onst "
(?c_str@?$basic _string@DU?$cha r_traits@D@std@ @V?$allocator@D @2@@std@@QBEPBD XZ)
bereits in Engine.lib(Wate rBox.obj) definiert

Can anyone help me?

Tnx,
Florian
Jul 19 '05 #1
1 4203
On Thu, 13 Nov 2003 13:08:20 +0100, Florian Liefers <re*****@web.de >
wrote:
"Hello World\n",

i have the following problem:
One of my headerfiles for a lib is including <vector>.
When i compile the lib, everything is done well.
In my application another file is including <map>.
By linking my application and the lib, following errors occur:
[SNIP errors]
Can anyone help me?


If you ask in the correct group you will get good help (usually). This
group covers the standard C++ language (and library) only, not
specific compiler installation problems. The error messages look
microsofty, so try microsoft.publi c.vc.stl or
microsoft.publi c.vc.language or similar.

Tom
Jul 19 '05 #2

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

Similar topics

2
3607
by: Sims | last post by:
Hi, I have a structure as follow struct sIntStructure { int m_nNumber; // // A few more variables //
3
10826
by: Juicer_X | last post by:
Hello everyone, I've been working with the STL Containers for a little while now, but in the middle of working on a small "Markov Chain" class I realized that I wanted to modify my frequency tables, so far I have been using maps like: std::map<std::string, int> frequency; A string for the letter combinations and an int for the frequency, but now I want to add three more frequencies:
19
6136
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 found anything). Here's the problem, I have two sets of files, the name of a file contains a number which is unique for each set but it's possible (even probable) that two files in different sets have the same numbers. I want to store these...
3
3499
by: Evgeny | last post by:
Hi, all! I didn't find yet solution for this problem! Somebody knows where is a catch? Looks like "operator =" or copy constructor not implemented in one of internal templates.... Thanks in advance class CMyBase;
13
5033
by: Steve Edwards | last post by:
Hi, Given a map: typedef map<long, string, greater<long> > mapOfFreq; Is there a quicker way to find the rank (i.e. index) of the elememt that has the long value of x? At the moment I'm iterating through the map and keeping count of when I hit it.
3
6401
by: Chris Jones | last post by:
Hi, I've experimenting with using boost::pool_allocator with std::vector and gcc (4.1)., and I am having problems with segmentation violations. Below I give a simple example of one way I am getting this // Include files #include <cmath> #include <iostream> #include <vector>
1
2346
by: OriginalCopy | last post by:
This is a demonstrative code which could be used for debugging purposes. And yet I don't know how to insert the necessary data on line 63, purely syntactically speaking ? I'm a beginner with STL, and from what I've read insert() accepts references for almost all of its overloaded versions. If so, what could one do so those element's memory space doesn't wipe out? I suppose one should use the heap. In rest I hope the code speaks for itself, it's...
6
7365
by: Mr. K.V.B.L. | last post by:
I want to start a map with keys but an empty vector<string>. Not sure what the syntax is here. Something like: map<string, vector<string MapVector; MapVector.insert(make_pair("string1", new vector<string>)); MapVector.insert(make_pair("string2", new vector<string>)); MapVector.insert(make_pair("string3", new vector<string>));
42
4519
by: barcaroller | last post by:
In the boost::program_options tutorial, the author included the following code: cout << "Input files are: " << vm.as< vector<string() << "\n"; Basically, he is trying to print a vector of string, in one line. I could
0
8297
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.