vileda
asked on
linker error ".... already defined in xxxx"
Hello,
I'm trying to compile a program but it gives an error like below:
Executing: ""C:\Rhapsody752\Share"\et
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
The filename, directory name, or volume label syntax is incorrect.
Building library deneme.dll msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,str
I added OpcServer.obj from another project. What's the problem here?
Could you help me please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have the source code so that you can compile it along with the rest of your project?
>> The error is a multiply defined symbol located in OpcServer.obj.
Note that the symbol is ~basic_string, suggesting mixed CRT
Note that the symbol is ~basic_string, suggesting mixed CRT
ASKER
I compiled my main program with /MT option and my libray OPCServer.obj with /MD option. I don't have any idea about how it worked but It worked.
>> I don't have any idea about how it worked but It worked.
are you saying that resolve it? I suspect that it's not really since you are still using two different C runtimes.
MT: Multithreaded, static link
MD: Multithreaded, dynamic link (import library for MSVCR80.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP80.DLL to run.
You should should the same C runtime otherwise you will (potentially) get undefined behaviour.
are you saying that resolve it? I suspect that it's not really since you are still using two different C runtimes.
MT: Multithreaded, static link
MD: Multithreaded, dynamic link (import library for MSVCR80.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP80.DLL to run.
You should should the same C runtime otherwise you will (potentially) get undefined behaviour.
ASKER
closed