I am compiling my program using VS2005. I am linking to SDL static libraries and am getting the following linker errors;

1>LIBCMTD.lib(fpinit.obj) : error LNK2005: __fltused already defined in SDL2d.lib(SDL_stdlib.obj)
1>LIBCMTD.lib(ftol2.obj) : error LNK2005: __ftol2_sse already defined in SDL2d.lib(SDL_stdlib.obj)
1>   Creating library ..\..\..\product\VS2005\libs\\Standalone.lib and object ..\..\..\product\VS2005\libs\\Standalone.exp
1>..\..\..\product\VS2005\libs\\Standalone.exe : fatal error LNK1169: one or more multiply defined symbols found

I compiled SDL2d.lib using the same VS2005 compiler. My original thought was that I had mismatched runtime library settings for these projects. However after checking they are both set to Multi-Threaded Debug.

I have just noticed that the linker output above seems to be creating a Standalone.lib and Standalone.exp before making the Standalone.exe. I have no idea why it's making a .lib and .exp

Any other reasons why this error would occur?


Question author Codetemplar | Source



Needed to define HAVE_LIBC in the SDL project. This stopped the multiple redefinition of both _ftlused and _ftol2_sse

Answer author Codetemplar

Ask about this question here!