0 Replies - 5000 Views - Last Post: 15 June 2008 - 12:18 PM Rate Topic: -----

#1 gabehabe   User is offline

  • GabehabeSwamp
  • member icon

Reputation: 1433
  • View blog
  • Posts: 11,006
  • Joined: 06-February 08

[resolved]Setting up SDL to work in Code::Blocks

Posted 15 June 2008 - 12:18 PM

I'm trying to set up Code::Blocks to work with SDL, but whenever I try to compile I get this error:


undefined reference to [email protected]

I can compile an ordinary program with no problems, but as soon as I #include <SDL/SDL.h> I get this error.

YES, my paths are right, SDL is being referenced correctly :P

And YES, I have my main written correctly: int main(int argc, char *argv[])

I've also been to settings>compiler and added:
C:\Program Files\CodeBlocks\MinGW\lib\libSDL.dll.a;C:\Program Files\CodeBlocks\MinGW\lib\libSDLmain.a;

I think it's something to do with linkers being in the wrong order, but I'm not too good with this stuff...

Pleeease help, this is driving me crazy... it's probably something really simple.

Thanks in advance :)

Now I feel stupid... All I had to do was go to Project > Build Options and pick these as the linkers:
C:\Program Files\CodeBlocks\MinGW\lib\libSDL.dll.a;C:\Program Files\CodeBlocks\MinGW\lib\libSDLmain.a;C:\Program Files\CodeBlocks\MinGW\lib\libmingw32.a

Thanks anyway :^:

This post has been edited by gabehabe: 15 June 2008 - 12:35 PM

Is This A Good Question/Topic? 1

Page 1 of 1