My SDL problem

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

Recommended Posts

Ok, i have just installed the SDL pack with the bloodshed dev c++ compiler and am trying to start using SDL. It has been sucssesfully installed with no problems. I went to cone3d and got a tutorial for SDL. When i tried to run the completed source code i got these errors: - [Linker error] undefined reference to SDL_LockSurface' - [Linker error] undefined reference to SDL_UnlockSurface' - and loads of other things that begin with SDL_... whats going wrong and how do i fix it?

Share on other sites
You must link to the SDL lib file (can't remember its name SDLMain.lib?).
I can't tell you exactly how to do this, because I don't know which compiler you are using.

Good luck,
Pat.

Share on other sites
i said before that im using 'bloodshed devc++' and where do i put this sdl lib file?

Share on other sites
yea i have read this but because bloodshed installed it for me shouldnt it be in the right place already?

Share on other sites
Quote:
 Original post by Hakui said before that im using 'bloodshed devc++' and where do i put this sdl lib file?

Sorry - it's kinda late here

Share on other sites
Quote:
 Original post by Hakuyea i have read this but because bloodshed installed it for me shouldnt it be in the right place already?

i dont know

go look

Share on other sites
Quote:
 Original post by Hakuyea i have read this but because bloodshed installed it for me shouldnt it be in the right place already?

Quote:
 from the link aboveNow in Dev-C++ start a new console project. Now go to the project options dialog (found in the menu Project). The thing we need to set here is the field that says "Further object files or linker options:". Type in "-lmingw32 -lSDLmain -lSDL" (w/o the quotes) inside it. Now click OK.

Are you sure you did that? I mean the bold part[/edit]

Share on other sites
hehe no i didnt, thnks!

Share on other sites
ok i fixed that bit but nowhen i try to compile the app it says SDL.Dll not found...what do i do?

Share on other sites
sdl.dll has to be in the same place as your program (*.exe)

Share on other sites
You need to copy the dll into the directory where your exe sits.

Share on other sites
when u say the exe. do you mean devc++ or my compilled app i have made?

Share on other sites
The compiled app.

Share on other sites
You could also put it in the C:\windows\system folder that way you wont have to put it where ever you exe is. It will just run from that folder.