# still have SDL problems

## Recommended Posts

for those of you who read my other thread, I am still having problems getting SDl to work. I downloaded the latest stable release, and ran an example program. I get the following error: "the procedure entry point SDL_SetModuleHandle could not be located in the dynamic link library SDl.dll" any help? I have the dll in the right directory and everything. [Edited by - jakpandora on September 21, 2004 1:57:18 PM]

##### Share on other sites
Show us your source code. It could help.

##### Share on other sites
Sounds like an outdated sdl.dll.

##### Share on other sites
Here is the source:

#include <stdio.h>#include <stdlib.h>#include <SDL/SDL.h>// The functions are not shown to save spacevoid DrawPixel(SDL_Surface *screen, int x, int y,                                    Uint8 R, Uint8 G, Uint8 B);void Slock(SDL_Surface *screen);void Sulock(SDL_Surface *screen);int main(int argc, char *argv[]){  if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )  {    printf("Unable to init SDL: %s\n", SDL_GetError());    exit(1);  }  atexit(SDL_Quit);  SDL_Surface *screen;  screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF);  if ( screen == NULL )  {    printf("Unable to set 640x480 video: %s\n", SDL_GetError());    exit(1);  }  // DRAWING GOES HERE  return 0;}

This is the exact same source from tutorial I got at the cone2d site. I dont think its an outdated dll, because it came with the latest stable release. the code compiles correctly and everything.

##### Share on other sites
what IDE are you using? i dont see where you include the library....

##### Share on other sites
The SDL_SetModuleHandle call is used for calling inside of a WinMain() function.

Since i dont see a WinMain function, chances are you either havent linked your sdl.lib library or the SDL.h file is in the wrong place, or depricated.

##### Share on other sites
I use dev C++ 4.0 and did everything exactly the way the tutorial told me to. I dont think it said to make a winmain() function, because it was supposed to be made in a console. also, I notice that when downloading the latest stable release, it is a tar.gz file or something like that. I thought that file formtat only worked with windows? if it doesnt, wouldnt I have to somehow manually extract the files instead of using winzip? I would have no idea where to put them if I did that.

##### Share on other sites
Can nobody help? I extracted all of the files and put them in the right folders, and I still get the problems. any help?

##### Share on other sites
If you are downloading a tar.gz file, than you are probably downloading a linux or unix version of whatever file it is. If it's got .h files, those will work, but any lib or runtime files will be incompatable.
edit: are you downloading this from the SDL website? They have a seperate build of the runtime environment for windows.

##### Share on other sites
I got it to work! I download the development files of version 1.2.7 with the tar.gz file extension for mygwin32. I replaced all the old files with the files from the old version, and everything worked. I still have one question, though. I downloaded all the tutorials fomr cone3d. while I understood pretty much everything from the first tutorial, I hardly understood half of the stuff from the second one. Do I have to know what everything is doing at every single time, or would I be ok just copying and pasting some of the stuff I dont understand for now?

##### Share on other sites
I just scanned over the third tutorial, and I noticed it assumed knowlage of classes. I dont really know if I am ready or not for classes, but, for the moment, can I just learn classes and nothing else related to OOP?(and possibly some things I should have learned before classes)

##### Share on other sites

yeah, you can learn classes and ignore oop for now.

also, if you just want to learn OpenGL without knowing c++, there is the super-cool Basic4GL

##### Share on other sites
I dont think I really want to learn anything else at the moment. SDL seems to be working good for me, and is relativly easy to understand. Thanks for everyones help!

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628367
• Total Posts
2982284

• 10
• 9
• 13
• 24
• 11