Wierd errors that never happened before...

Recommended Posts

I'm getting these strange (to me) errors whenever I try to compile anything (even, oddly enough, stuff that used to work)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __alloc_osfhnd already defined in LIBCD.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __set_osfhnd already defined in LIBCD.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __free_osfhnd already defined in LIBCD.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __get_osfhandle already defined in LIBCD.lib(osfinfo.obj)
LIBCMT.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already defined in LIBCD.lib(osfinfo.obj)
LIBCMT.lib(dosmap.obj) : error LNK2005: __dosmaperr already defined in LIBCD.lib(dosmap.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/ss.exe : fatal error LNK1169: one or more multiply defined symbols found


I have installed STLPort, but it doesn't look like that's the problem. I'm running VC++6 under WinXP. Thanks in advance. [EDIT] Actually, it seems to be only console apps. [EDIT2] I've narrowed it down. iostream is the problem.

Share on other sites
Those errors sound like the "ignore default .lib problem".

libcd.lib would be the single-threaded debug version of the c runtime libraries.

libcmt.lib would be the multi-thread release version.

Clearly, those are not meant to co-exist in the same app [smile]

There should be a setting in your project's properties that allows you to configure which runtime libraries to ignore, so that there are no name clashes.

Share on other sites
Ahh, thanks. I really should have just looked at the help, instead of bothering you people. It's been a long day.

I appreciate the help. rating++

Create an account

Register a new account

• Forum Statistics

• Total Topics
627746
• Total Posts
2978906

• 10
• 10
• 21
• 14
• 14