conflicts with library

C

Christian Galbavy

Hello!

I have a problem with linking a prog. (I am using MS Visual Studio 6 on
Windows XP).
I have a c++ program and want to create a dll-file from it.

The compilation is no problem, there are no errors.
But the linker gives the following errors. There is some conflict with the
lib msvcprt.lib
************************************
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall
std::ios_base::Ini
t::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in
libcp.lib(iostr
eam.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall
std::ios_base::Ini
t::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in
libcp.lib(iost
ream.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall
std::_Winit::_Wini
t(void)" (??0_Winit@std@@QAE@XZ) already defined in libcp.lib(wiostrea.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: __thiscall
std::_Winit::~_Win
it(void)" (??1_Winit@std@@QAE@XZ) already defined in libcp.lib(wiostrea.obj)
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "public: __thiscall
std::ios_base::I
nit::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in
libcp.lib(ios
tream.obj); second definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "public: __thiscall
std::ios_base::I
nit::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in
libcp.lib(io
stream.obj); second definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "public: __thiscall
std::_Winit::_Wi
nit(void)" (??0_Winit@std@@QAE@XZ) already defined in
libcp.lib(wiostrea.obj); s
econd definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "public: __thiscall
std::_Winit::~_W
init(void)" (??1_Winit@std@@QAE@XZ) already defined in
libcp.lib(wiostrea.obj);
second definition ignored
Creating library apfloat.lib and object apfloat.exp
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
libs; us
e /NODEFAULTLIB:library
apfloat.dll : fatal error LNK1169: one or more multiply defined symbols
found
*************************************

Thanks for any help!
Havanciday
Christl
 
V

Victor Bazarov

Christian said:
I have a problem with linking a prog. (I am using MS Visual Studio 6 on
Windows XP).
I have a c++ program and want to create a dll-file from it.

This is nice to know, but it has no relevance here, most of the time.
The compilation is no problem, there are no errors.

Unfortunately, that's where the scope of this NG ends.
But the linker gives the following errors. There is some conflict with the
lib msvcprt.lib
************************************
[...]
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
libs; us
e /NODEFAULTLIB:library

Can you see the suggestion in this message?
apfloat.dll : fatal error LNK1169: one or more multiply defined symbols
found
*************************************

Multiply defined symbols can only be resolved by removing all but one
definition of the symbol, AFA C++ is concerned. If several libraries
conflict, you need to get rid of some of them, I suspect. To better
understand that issue and how to remove those libraries, post your query
to microsoft.public.vc.language, the newsgroup for your compiler.

V
 
P

Pete Becker

Victor said:
But the linker gives the following errors. There is some conflict with the
lib msvcprt.lib
************************************
[...]
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
libs; us
e /NODEFAULTLIB:library

Can you see the suggestion in this message?

Agreed, he should definitely go to a VC newsgroup. Just to clarify,
though, I have never yet seen a situation in which the linker's
suggested /NODEFAULTLIB is the right answer. Figure out where the
conflict is coming from and fix the problem. In this case some .obj
files were compiled to use the static runtime, and some to use the
dynamic. They don't mix.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top