Sign in to follow this  

Codeblocks Setup with SDL

This topic is 2040 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

I am trying to setup Code::Blocks to use SDL. I have all the libraries setup per this tutorial.

[url="http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.php"]http://lazyfoo.net/S...ocks/index.php[/url]

I am currently getting this error:

File ld.exe cannot find -lSDLmain


I know the code works; I have had my comp reformatted recently, and have taken the code from a backup. I believe that there is a step that I have forgotten in reinstalling Code::Blocks and SDL. Can anyone explain to me what this error is exactly, so I have a better idea of what to look for?

Share this post


Link to post
Share on other sites
I just tried -lSDL_main, it doesnt work either; plus I remember -lSDLmain working from before I reformatted.

Share this post


Link to post
Share on other sites
The error message you are getting is indicating that the linker (ld.exe) can't find a library (SDLmain.dll). I am not familiar with CodeBlocks, but see if there is a way to put in search directories that contain your libraries. The other possibility is that when you built/installed libSDL, it didn't create or put SDLmain.dll in a "well known" location (for example, in linux, a well known location is usually /usr/local/lib, /usr/lib or /opt/lib)

Share this post


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