Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking issues

Status
Not open for further replies.

jhopper

Programmer
Mar 15, 2004
6
AU
I am writing an application in Visual Studio 6, c++, and am getting the following linking error (and several others like it)

libcpmt.lib(iostream.obj) : error LNK2005: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP60D.dll)

However I am NOT including libcpmt.lib, so I have no idea why it is being compiled. any ideas?
 
I think I have seen this before. did you #include <iostream.h> in your code? I think "using namespace std" may fix your problem. You may or may not need the include.

Matt
 
FYI
I ended up pulling the application into 3 seperate application (there were three parts to it), got each of them working fine, and then merged them all togeather. At that point the problem kinda went away. not real sure why, but I think it has to do with the order that I was including things.
 
You have object modules compiled earier with different and inconsistent settings in your project. See the message text: libcpmt.lib is a (RTL) multi-threaded release library with static linkage, but msvcprtd.lib is a multi-threaded debug library with dynamic linkage.

Rebuild all the project to compile (then link) modules in consistent manner. Verify your includes: only <iostream>, never <iostream.h>!..

See MSDN with msvcprtd keyword...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top