Jump to content
  • Advertisement
Sign in to follow this  
CoderGuy

An SDL problem.

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I got SDL working fine on my home computer using Dev CPP. My problem is that I put Dev CPP and SDL on my friend's compter, but I'm getting errors. It will compile, but I get compiler errors. I put all the SDL header files in the SDL directory in the Dev CPP include directory and all the SDL library files and SDL.DLL in the Dev's library directory too. I then went into project options and linked up all the necessary components. SDL and OpenGl work fine on my home computer, but I'm not sure why I'm getting a problem with SDL on my friend's. And here's what's in the linker: -lmingw32 -lSDLmain -lSDL
#include <SDL/SDL.h>   /* All SDL App's need this */
#include <stdio.h>

int main(int argc, char *argv[]) {
    
    printf("Initializing SDL.\n");
    
    /* Initialize defaults, Video and Audio */
    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { 
        printf("Could not initialize SDL: %s.\n", SDL_GetError());
        exit(-1);
    }

    printf("SDL initialized.\n");

    printf("Quiting SDL.\n");
    
    /* Shutdown all subsystems */
    SDL_Quit();
    
    printf("Quiting....\n");

    exit(0);
}

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by CoderGuy
I put all the SDL header files in the SDL directory in the Dev CPP include directory and all the SDL library files and SDL.DLL in the Dev's library directory too.


If you put SDL.H in the directory you will just use #include <SDL.h>. If you have it in a folder named SDL residing in the include folder, then what you have is fine.

What are the errors you are getting?

Share this post


Link to post
Share on other sites
I do have it in SDL/SDL.h. My errors are:

39 c:\dev-c_~1\include\sdl\sdl.h
from c:\documents and settings\john moore\desktop\sdltest.c:1:

97 c:\dev-c_~1\include\sdl\sdl_audio.h
warning: `__cdecl__' attribute directive ignored

When I compile it, it creates no errors, but it must have linker problems because it does not create the executable.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!