0

When I use the /MT flag with ICC 14 I get these errors:

1>  xilink: executing 'link'
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: isspace already defined in LIBCMT.lib(_ctype.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: __iob_func already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: fprintf already defined in LIBCMT.lib(fprintf.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR120.dll) : error LNK2005: realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __cdecl type_info::type_info(class type_info const &)" (??0type_info@@AEAA@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __cdecl type_info::operator=(class type_info const &)" (??4type_info@@AEAAAEAV0@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>D:\forgottenserver-master\vc12\x64\Release\theforgottenserver.exe : fatal error LNK1169: one or more multiply defined symbols found

I have no idea what is causing this and when I use the /MD flag everything works fine

I'm using ICC version 14 with MSVC 2013 ultimate and I'm compiling a program for x64 with boost (I compiled those files for the iw platform myself and they appear to work)

3
  • 1
    How about use /nodefaultlib:MSVCRT? Commented Jun 28, 2014 at 22:21
  • 1
    You should not need to specify /nodefaultlib:msvcrt. If you are getting the errors you describe, it means some objects in your linker were compiled with /MT and others were compiled with /MD. You can't mix-and-match; all source files need to be compiled with the same option. Commented Jun 28, 2014 at 23:44
  • @JamesMcNellis How do I compile the libs that are mentioned in the error with the /MT flag? Commented Jun 29, 2014 at 0:32

1 Answer 1

-2

Try to specify LIBCMT in Properties -> Linker -> Ignore Specific Default Libraries

Sign up to request clarification or add additional context in comments.

6 Comments

Fixing multiply-defined symbol errors by ignoring them is never a good idea. The mixture of runtimes is quite likely to lead to subtle and hard-to-diagnose memory bugs.
I said "Try", not "You must"
If he tries it, it'll work. Then a while later, he'll get a crash when he tries to resize a vector, and he'll have no idea why.
this is called "experience" :)
So your plan is to willfully mislead him so that he has to struggle to figure out you were willfully misleading him, rather than just teaching him what he needs to know? That's... i dont even.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.