Jump to content
  • Advertisement
Sign in to follow this  
Bow_vernon

Argh, link failed with SDL >.<

This topic is 2613 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, recently I wanted to try to use 3rd party library, in this case it's SDL. So I coded a simplest SDL app possible like this:

#include "SDL\sdl.h"
#include <stdio.h>

int main(int argc, char** argv)
{
return 0;
}


I've put the headers in the right folder, there should be no problem with missing headers, etc... but I always got the error:

[color="#FF0000"]--------------------Configuration: test - Win32 Debug--------------------
Compiling...
main.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

test.exe - 2 error(s), 0 warning(s)


it happens if I don't link the project with the library (.lib file). but even after I link it, there's still some errors (even worse), like:

[color="#FF0000"]--------------------Configuration: test - Win32 Debug--------------------
Compiling...
main.cpp
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
LIBCD.lib(crt0init.obj) : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/test.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

test.exe - 4 error(s), 1 warning(s)

I've been googling to see if someone experienced similar problems, but I ran out of luck (or am just being lazy :P). I'm using MSVC6.0 (I know, stop blaming me for using OLD IDE). I've tried to pick n play the configuration but it still didn't work. I'm confused and beg anyone to help. Thanks before

Best Regards,

Bow Vernon

Share this post


Link to post
Share on other sites
Advertisement
Umm never mind, I already solved it by setting the code generation to "Multithreaded DLL" and it works fine now! thanks for the response though :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!