Author Topic: Code::Blocks + SDL, not working!!! (ld.exe||cannot find -lSDL.dll|)  (Read 10455 times)


  • Guest
Ok, so after (unsuccessfully) trying to get SDL to work with visualstudio, I decided to try Code::Blocks (besides, from what I saw code::blocks was much more epic, plus its free).  I was excited to learn that to get it to work with SDL all i had to do was point it to the directory!!


i get this weird error when compiling:

-------------- Build: Debug in SDL Test ---------------

Linking console executable: bin\Debug\SDL Test.exe
C:\SDL\lib/SDLmain.lib(./release_nostdio/SDL_win32_main.obj):(.text[_main]+0x0): multiple definition of `_main'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../libmingw32.a(main.o):main.c:(.text+0x0): first defined here
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot find -lSDL.dll
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 0 warnings
so i followed various guides on how to put the libs, bins, etc in various folders on the computer + spamming the sdl.dll file everywhere.  Anyway whatever I do i end up getting the same error. 

Offline cs_student

  • Single posting newcomer
  • *
  • Posts: 3
Re: Code::Blocks + SDL, not working!!! (ld.exe||cannot find -lSDL.dll|)
« Reply #1 on: September 20, 2008, 07:45:31 pm »
I'm not quite sure what is causing the problem, but why don't you follow the guide here for setting up SDL.  It guides you in setting up SDL on every popular platform and IDE.

As for spamming SDL.dll everywhere, you can either just keep it in the same directory as your executable, put in in the system path, or put it in system32 (however I don't recommend the latter).
However, I would make sure you have done one, because from the build message it looks as though it can't find SDL.dll.

« Last Edit: September 20, 2008, 07:52:27 pm by cs_student »