Thread: SDL problem

  1. #1
    Registered User
    Join Date
    Nov 2009

    Question SDL problem

    when I try to compile a program it gives me this error during the linking part
    \mingw\lib\libmingw32.a(main.o):main.c:(.text+0xd2)||undefined reference to `_WinMain@16'|

  2. #2
    Registered User
    Join Date
    Aug 2005
    You have to tell the compiler that you are compiling a Windows GUI program.
    Otherwise it thinks you are trying to compile a console program and you will get the above error.

    Add this to your compiler flags "-mwindows"
    Or if you aren't using the command line you will have to tell your IDE that you want a GUI
    program not a console one.

  3. #3
    Internet Superhero
    Join Date
    Sep 2006
    I'm not sure whether the above posters advice would solve your problem, but that error is the exact same that i get when i forget to define main correcty:

    int main(int argc, char *argv[])
    Your int main() must look like the above for SDL to work...
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with SDL
    By Mirchiss in forum Game Programming
    Replies: 1
    Last Post: 07-16-2006, 01:03 PM
  2. SDL Performance problem
    By cboard_member in forum Game Programming
    Replies: 8
    Last Post: 04-09-2006, 01:23 PM
  3. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  4. SDL problem
    By ElastoManiac in forum Game Programming
    Replies: 11
    Last Post: 01-11-2006, 02:45 AM
  5. Replies: 5
    Last Post: 11-07-2005, 11:34 PM