Visual Studio + Sdl


MichaS

Still Fresh
Joined
Sep 4, 2008
Messages
5
Hello,

I am new to GP2X Development and I hope you can help me for the final start.

I've sucessfully managed Visual Studio in comibination with devkitGP2X. I've used the tutorial "Using_Visual_C_2005_Express_Edition" from wiki.gp2x.org. I can compile a *.gpe file. But as soon I am trying to work with SDL, I get into problems. It's think it's all about my linker setting thinking.

The story starts that Visual Studio complains with "undefined reference to `SDL_Init'". Okay, now I am adding "SDL.lib" and "SDLmain.lib" to "Additional Dependencies" of the "GCC Linker" entry (Right-Click on the project name -> Properties) and the path to the libs to "Additional Library Paths".

But all I get is "..\..\..\..\arm-linux\bin\ld.exe: cannot find -lSDL.lib"

Any hints for me?

Thank you,
Micha.
 
Hi Micha, from the information you give it looks like you might be passing the libs in incorrectly. When using the toolchain they should be give as -lSDL without the .lib on the end.
You might also find that changing the order of the libraries help. SDLmain should come before SDL, i know it sounds odd but ive fallen foul of similar linking problems in the past. So you libraries should be "-lSDLmain -SDL".

Hope that helps :)
 
I followed the setup instruction of Visual Studio perfectly and still could not get it to link properly. However, after adding 'pthread' as an additional library dependancy (just put it after SDL), it finaly spewed out a GPE :)

Thanks KungPhoo!
 
Why are you using the Win32 SDL libraries for GP2X?

Or are you just trying to get a Windows SDL program running?
 
I am not using the Win32 SDL libraries. I only added a path to the libs- and includes that came with DevkitGP2X. I got alot of errors pertaining to SDL semaphores and threads, and linking pthread along with SDLmain and SDL fixed the problem. Tested the resulting GPE on the GP2X and it's working as it should?
 
Hi,

Thanx to all of you and your help.
Yes, I've mixed different libraries with different targets. I've configured now a scenario to build the application for Windows and GP2X. It works.

Thanx,
Micha.
 
Back
Top