Computer Science Canada

Trying to setup SDL with DevC++, please help?

Author:  SpaceKiwi [ Thu Dec 30, 2010 10:38 am ]
Post subject:  Trying to setup SDL with DevC++, please help?

I just can't seem to get it to work.
Here are step-by-step instructions I've tried to follow:
http://lazyfoo.net/SDL_tutorials/lesson01/windows/devcpp/index.php
Which basically say to tell DevC++ to look in the include folder, and lib folder, of SDL, and to enter certain data in the linker parameters. I'm pretty sure I did it all correctly. So I load up one of SDL's included tests, (testwin.c to be exact) and try to compile and run, and recieve these errors:
    [Linker error] undefined reference to `__dyn_tls_init_callback'
    [Linker error] undefined reference to `__cpu_features_init'
    ld returned 1 exit status
    C:\Dev-Cpp\Makefile.win [Build Error] [Project1.exe] Error 1

Further more, when trying another test file, testsprite.c, I recieve (among many others) an error saying
    10 C:\SDL-1.2.14\test\testsprite.c SDL.h: No such file or directory.

However, there definitely is an SDL.h file.
I can't quite imagine what's wrong, so if anyone could help me get this working (and especially explain how you know how to get it working), I would be much appreciative. Smile

DevC++ version 4.9.9.2
SDL 1.2.14
Compiler is... whatever comes with or is used by DevC++?

Author:  TerranceN [ Thu Dec 30, 2010 2:12 pm ]
Post subject:  RE:Trying to setup SDL with DevC++, please help?

I tried the tutorial and had no problems, maybe the samples used other libraries, just try the test code on the tutorial.

Also, I believe SDL.h is in the subdirectory of SDL's include folder called SDL. So your include line would look like #include "SDL/SDL.h"

Author:  SpaceKiwi [ Fri Dec 31, 2010 2:07 pm ]
Post subject:  Re: Trying to setup SDL with DevC++, please help?

That sure was the problem: The files are not within the include folder, but within a "SDL" folder inside the include folder. All I had to do was specify the include\SDL folder. Thanks for the help! Very Happy


: