SDL problem

ok so i am having a problem with making/opening SDL files and i dont want to keep going with learning SDL programming until i get this problem fixed.

the problem is that when the SDL.dll is in the system32 folder the program won't compile. If the '.dll' isn't in the system32 it compiles but wont run the .exe. i have re-installed the packages and the DEV C++ software but still the same problem.

in a related post, some one told me to look at the $PATH. how do you do this and any ideas on how to fix this?
That doesn't make sense. The DLL is not necessary to compile. MinGW uses .a as static libraries. Check that you're linking them to your code. IINM, to use the DLL you need SDL.a and SDL.dll.a.
IINM, to use the DLL you need SDL.a and SDL.dll.a.

do i have to do this manually in the code. i thought the compiler would know to do this.
No. The only library I know of that makes the compiler automatically link static libraries is Boost, and only because it uses extended preprocessor directives.

I never used Dev-C++ to link static libraries, so I can't help you much, there. Look in your build options (they are there, somewhere) for some way to pass arguments to the linker and add
-lSDL -lSDL.dll
The linker automatically prepends the lib and appends the .a to the file name. In order for this to work, you must have put the libraries somewhere where the linker can find them, like (path to Dev-C++)lib\.
i looked through my library and i found libSDL.a and libSDL.dll.a? is this the same? does it matter with the 'lib' in it. probably, depends on the compiler...
I hope you are using Lazy Foo' Productions' tutorials. Make sure you set up the Dev-C++ according to the instructions there and you shouldn't have any problems.
http://lazyfoo.net/SDL_tutorials/lesson01/windows/devcpp/index.php

If, after checking that everything matches, you are still having problems then let us know and we'll go the rounds with the link stuff with you.
how do you open a .tar file?
got it working now. thanks guys. what if i want to give my program to a friend? do i just include the SDL.dll along with the executible?

and also(not too be a pain,hehe) is there a PDF on sdl programming that anyone knows of? i prefer to work off of a hard copy.

thanks...
Last edited on
SDL Comes with documentation from memory that's pretty handy. Otherwise take a look at all the tutorials on the site (http://lazyfoo.net ) Duoas mentioned. It's a great site to get you going.
Last edited on
Topic archived. No new replies allowed.