Cannot create SDL window!!(PLEASE HELP!)

This is a discussion on Cannot create SDL window!!(PLEASE HELP!) within the Game Programming forums, part of the General Programming Boards category; Hi. I am learning SDL, and I can't get it to work. I am using the Dev-C++ 4.01 IDE and ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Post Cannot create SDL window!!(PLEASE HELP!)

    Hi. I am learning SDL, and I can't get it to work. I am using the Dev-C++ 4.01 IDE and the MinGW compiler. When I link to -lsdl and -lsdlmain and do this:

    #include <SDL\SDL.h>
    #include <stdlib.h>
    #include <stdio.h>

    int main(int argc, char *argv[])
    {

    return 0;
    }

    It doesn't compile and the linker says:

    Undefined reference to `WinMain@16'
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    I don't use SDL but since the error says "WinMain", I'm thinking you need to include <windows.h>.

  3. #3
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    You have to have the libraries in the right order.

    try this:
    -lmingw32 -lSDLmain -lSDL
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL & Direct3D - Event loop clogged up?
    By cboard_member in forum Game Programming
    Replies: 6
    Last Post: 04-11-2006, 02:29 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  3. How to create a file association program?
    By eShain in forum Windows Programming
    Replies: 1
    Last Post: 03-06-2006, 11:15 AM
  4. DirectX or SDL?
    By Leeman_s in forum Game Programming
    Replies: 2
    Last Post: 01-19-2003, 09:13 PM
  5. How to Create reference to an array in C++
    By shiv_tech_quest in forum C++ Programming
    Replies: 2
    Last Post: 12-20-2002, 09:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21