Skip to main content
GameDev.net gamedev.net
🔒 Locked

Hello, problem with SDL.

Started by Answer3 Oct 18, 2008 at 5:21 AM 8 replies 1.2k views
Original Post
Answer3
Answer3
Hello, I have some problem in SDL, that I trying to solve long time. Once I wrote simple tic-tac-toe game, and I used SDL. Then I gave this game to some of my friend to check it, they told me that the game didn't work and it gave them some errors(I put all the SDL files with my exe file). So after that, I wrote a simple program using SDL, it's just opens window with white image. I gave it again to some of my friends, it still didn't work on their computers and gave the errors, but not to all of them, there were some who had c++ installed on their computers and it worked for them, but the game didn't work and it asked for FreeType dlls or something like that, some of them told me that the error they receive is something with problem in developing and reinstall program can help or something like that. So my question is, what is the problem? May be you met it before or something that can help me? I am apologize for my english. Thanks, and I hope for answers.
MrPickle
MrPickle
You must include the DLLs with you distribution.

SDL DLLs can be found Here (Under Runtime Libraries, Downlod the relevant one)

SDL_TTF DLLs can be found Here (Under Binarys, again Download the relevant one)

It is the same as SDL_TTF for SDL_mixer, SDL_net, SDL_image and any other library.
Here to learn :)
Ezbez
Ezbez
What compiler? And as always, give the exact error message.
android_808
android_808
Have the got the VC++ runtime for the version of the compiler installed? (Either Visual studio or runtime redistributable). I had this issue with something after I just reformatted.

Just to clarify MrPickle, you need to include all of the DLLs provided in the packages he mentions. As you mention it asking for FreeType DLLs it suggest to me that you have no include libfreetype as provided in the SDL_TTF binary download.
Answer3
Answer3
One second, I didn't understand something.

When I started programing with SDL, I download the zip file under the "Development Libraries" title, the file is "SDL-devel-1.2.13-VC8.zip" and the SDL.dll that was there I worked with and I put it with the exe in the folder when I gave it to my friends. It's not the same SDL.dll like in file under "Runtime Libraries" title?

I little confused.

Thank you again.
MrPickle
MrPickle
They are the same yes, but did you include all the other dlls that were in the folder?
Here to learn :)
cclyde
cclyde
Im pretty sure the libs are the same. You are simply not including all the required DLLs. Just take the DLL it asks for, and put it next to the exe. Easy.

Also, if you listed the specific errors, that would be helpful.
Answer3
Answer3
Ok, I did copy all the dll's it still didn't work.

I mean looked at this program

 #include "SDL/SDL.h"#include <string>SDL_Surface *screen = NULL;SDL_Surface *image = NULL;SDL_Event wEvent;SDL_Surface *load_image( std::string filename ) {	SDL_Surface* loadedImage = NULL;    SDL_Surface* optimizedImage = NULL;    loadedImage = SDL_LoadBMP( filename.c_str() );    if( loadedImage != NULL )    {        optimizedImage = SDL_DisplayFormat( loadedImage );        SDL_FreeSurface( loadedImage );    }    return optimizedImage;}void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination){    SDL_Rect offset;    offset.x = x;    offset.y = y;    SDL_BlitSurface( source, NULL, destination, &offset );}int init(){	SDL_Init(SDL_INIT_EVERYTHING);	screen = SDL_SetVideoMode(500,500,32,SDL_SWSURFACE);	return 0;}void quit(){	SDL_FreeSurface(screen);	SDL_FreeSurface(image);	SDL_Quit();}int main(int argc,char **args){	int q = 0;	init();		image = load_image("ch2.bmp");	if(image == NULL)		return 1;	while(q == 0)	{		apply_surface(0,0,image,screen);		SDL_Flip(screen);				if( q != 1)		{			SDL_WaitEvent(&wEvent);			if(wEvent.type == SDL_QUIT)				q = 1;		}	}	quit();	return 0;}


all it needs is SDL.dll(but I put all) I gave it to my friend and he told me again about the problem(I cannot copy the problem becouse it is not in english, but it says something with developing problems or something like that ...), I gave it to someone who have VC installed on his computer and it worked, I dont know why ...


ahhh and if it is important to notice it is on "Release mode".
evillive2
evillive2
Quote:
there were some who had c++ installed on their computers and it worked for them

As android_808 said this is most likely due to other people not having the right or any version of the Visual C++ runtimes (MSVCRT(D).dll) installed.
Evillive2
Ezbez
Ezbez
Also note that SDL throws a little wrench in there, too. It needs the redistributables for whatever version of VC++ it was compiled on. I found it was best to instead compile SDL from source using the same configuration as you're using for your game.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.