Thread: SDL Packs in Dev C++

  1. #1
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428

    SDL Packs in Dev C++

    I visited a site http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut1 after a suggestion to look into SDL packs for basic graphics. I followed the instructions but they are vague since I just downloaded dev c++ a few days ago and have the most recent beta version. I thought I understood where to add the linkers to the project in but I copied some basic code on how to initialize the software and it came back with.
    "Linkerer error undefined reference to 'SDL_Init'
    Linkerer error undefined reference to 'SDL_GetError'
    Linkerer error undefined reference to "WinMain@16'"

    All I entered into an already working program was

    Code:
    #include <SDL/SDL.h>
    
    int main()
    {
        if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) <0 )
        {
               cout<<"Unable to init SDL: %s\n", SDL_GetError();
               return 1;
        }
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    There is alot more code but it all works without these two additions so I didn't bother posting it. Thank you for your time.

  2. #2
    C++11 User Tux0r's Avatar
    Join Date
    Nov 2008
    Location
    Sweden
    Posts
    135
    link with -lmingw32 -lSDLmain -lSDL

  3. #3
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    I found the answer. To anyone to who reads this because you are having the same problem use Download Dev-C++ Development Packages from SourceForge.net
    it is an easier download directly into your compiler with a sample SDL code template. Sorry to anyone whos time I have wasted.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems compiling this SDL app
    By Rider in forum C++ Programming
    Replies: 3
    Last Post: 03-27-2007, 12:22 PM
  2. getting SDL to work with Dev-Cpp
    By linucksrox in forum Game Programming
    Replies: 5
    Last Post: 10-24-2005, 11:43 AM
  3. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  4. Attention Dev C++ Sdl Users!
    By Blizzarddog in forum Game Programming
    Replies: 0
    Last Post: 05-11-2003, 02:09 PM
  5. sdl in c++
    By Klinerr1 in forum C++ Programming
    Replies: 8
    Last Post: 07-07-2002, 07:46 AM