I had this problem when I built a simple games using OpenGL and SDL under Windows XP, with Visual Studio 6 SP6. I was using prebuilt binaries from libsdl.org, and got the "duplicate symbols" error.

After a bit of browsing, I found out that this error occurs if you link against libraries built with the "wrong" setting. MSVC6 appearantly want your libraries built as "Multi-threaded DLL".

I rebuilt SDL from source, changing all projects to "Multi-threaded DLL" under "Projects->Settings: C/C++ tab, 'Code generation'".

This solved the linking errors.

However I didn't find any deeper information about this issue, and I suspect that this solution might not be the best one. It DID NOT work on SDL_mixer, which I also rebuilt myself, including all static libraries such as libvorbis etc. At this point I gave up on MSVC6 and moved the project over to linux/g++.

Martin Persson, Sweden d02mape 'weird-a' stud.hh.se

--- It looks like another way to solve this problem is to check the "NoDefaultLibarys" and add "MSVCRT.LIB" (or "MSVCRTD.LIB" for debugging) to your project manualy. I only needed to do that after I made a new 'Console App'

The explanation to this problem is found in this M$ KB article: KB140584 "HOWTO: Link with the Correct C Run-Time (CRT) Library"

FAQ_Windows_Link_Errors_MSVCRT.LIB_or_LIBC (last edited 2008-04-17 08:18:10 by localhost)