Sdl Problems W/ Code::blocks


Snapple

Still Fresh
Joined
May 9, 2007
Messages
2
I wanted to start coding for the GP2X, so I followed the instructions given in this file:
gp2x%20-%20Development/Documentation/HowToWinGP2X.pdf

I performed the steps, installed MinGW and its SDL, but I'm now stuck at step 6-g. When I try to compile the default project in CodeBlocks, it gives me the following error in the build messages tab:
CODE
ld.exe cannot find -lSDL_image

I went to the Compiler and Debugger window and removed SDL_image from the set of link libraries. When I tried to compile it again, it gave me a similar error, but it said -lwinmn instead. I removed winmn and then it compiled okay. But, when the program ran it told me it couldn't find SDL.dll. I have no clue what the problem is. I need some advice.
 
DevStar said:
I wanted to start coding for the GP2X, so I followed the instructions given in this file:
gp2x%20-%20Development/Documentation/HowToWinGP2X.pdf

I performed the steps, installed MinGW and its SDL, but I'm now stuck at step 6-g. When I try to compile the default project in CodeBlocks, it gives me the following error in the build messages tab:
CODE
ld.exe cannot find -lSDL_image

I went to the Compiler and Debugger window and removed SDL_image from the set of link libraries. When I tried to compile it again, it gave me a similar error, but it said -lwinmn instead. I removed winmn and then it compiled okay. But, when the program ran it told me it couldn't find SDL.dll. I have no clue what the problem is. I need some advice.

If you are using windows then the SDL.dll SDL_Image.dll whatever.dll have to be in the PATH of your system.
 
Last edited by a moderator:
For linking, you'll need them in the link-path somewhere; mingw is just gcc, so on the gcc command line you can expect to see -L <path> to point to where the libs can be found; -l<lib> says "need a lib", but -L says "where to find it". You'll also need it during runtime, being a dll, but you're at the link stage still.

(I don't use code::blocks)

jeff
 
Thanks you guys. The sample sdl app booted up just fine. I'm ready to enter the ever-expanding field of coding for the GP2X!

EDIT: Well, almost ready. After following the tutorial's instructions to the letter, and even after tweaking it a bit, when I try to compile for the GP2X it says all of the SDL functions are undefined, ie:
CODE
main.cpp:(.text+0x1c): undefined reference to `SDL_Init'
main.cpp:(.text+0x30): undefined reference to `SDL_GetError'
main.cpp:(.text+0x68): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x80): undefined reference to `SDL_GetError'
main.cpp:(.text+0xa8): undefined reference to `SDL_RWFromFile'
main.cpp:(.text+0xb8): undefined reference to `SDL_LoadBMP_RW'
etc...

I'm starting to distrust this tutorial. Can anyone give me a good tutorial for CodeBlocks? Should I even be using CodeBlocks? Perhaps I should be using a different IDE? Any opinions welcome!
 
Back
Top