Find the answer to your Linux question:
Results 1 to 6 of 6
Ok ive compiled and installled the Open SDL library. The problem is that i cant get any of the examples to compile. The compiler tells me that the SDL.h doesnt ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314

    Using the open sdl library


    Ok ive compiled and installled the Open SDL library.

    The problem is that i cant get any of the examples to compile.

    The compiler tells me that the SDL.h doesnt exist.

    Also does any body know any decent tutorials for SDL. All of the ones ive found stink!!
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  2. #2
    Just Joined!
    Join Date
    Jun 2003
    Location
    Helsinki, Finland
    Posts
    78
    Where is your SDL.h? Mine's in /usr/include/SDL/SDL.h , so I'd guess I'd need to include it as #include <SDL/SDL.h>

    How are you including it?

  3. #3
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    I got it working

    I didnte realize that on the command line that i had to link the library.

    here is what i have to do

    g++ files -lSDL
    thats the ugly way.

    By the way how would a make file look for this.
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  4. #4
    Just Joined!
    Join Date
    Jun 2003
    Location
    Helsinki, Finland
    Posts
    78
    Well, you could:

    Code:
    prog&#58; file1.c
        g++ -o prog file1.c -lSDL
    Or better yet:
    Code:
    CC = g++
    INC = -lSDL
    prog&#58; file1.c
        $&#40;CC&#41; -o prog file1.c $&#40;INC&#41;
    Also, you can use sdl-config --cflags to find out all the CFlags to pass, and --libs to find all the libs you should include.

  5. #5
    Just Joined!
    Join Date
    Jun 2003
    Location
    Helsinki, Finland
    Posts
    78
    I'm thinking about learning SDL also. I just found a great book which introduces SDL. It's called Programming Linux Games and it's published by NoStarch. http://www.nostarch.com/plg.htm

  6. #6
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    Ive found this great tutorial

    here it is

    http://<br /> <a href="http://cone3...ndex</a><br />
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •