Sign in to follow this  
jakpandora

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 this post


Link to post
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 space
void 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 this post


Link to post
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.

Upgrade to SDL 1.2.7 or link your lib files correctly...what compiler?

Share this post


Link to post
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this