Thread: SDL and cygwin

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    48

    SDL and cygwin

    Hi i am currently trying to get SDL working with C language

    I am using Cygwin and Sublime text 2

    I know and understand general programming, however i am trying to understand how to get SDL working with a file i create i.e test.c

    i know to include which i have downloaded

    #include <SDL.h>

    now my question is where do i add the libraries so that i can use them in my program?

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    What you need to do should be similar to the instructions here:
    Setting up the SDL on Windows - Cprogramming.com
    Except you will need to look for include directory that cygwin uses. If you've installed cygwin in a typical fashion, it should be in a directory like:
    Code:
    C:\cygwin\lib\gcc\i686-pc-cygwin\4.8.2\include
    Basically dig in the gcc folder until you find include.

    Move the DLL over as the tutorial suggests.

    You should still create a basic SDL application just to test the install.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    48
    hi there thanks for the advice

    i did what you suggested and i get this error in cygwin

    $ gcc -o sdl sdl.c
    sdl.c:1:17: fatal error: SDL.h: No such file or directory
    #include <SDL.h>
    ^
    compilation terminated.

  4. #4
    Registered User
    Join Date
    May 2008
    Posts
    48
    this is the file i try to compile

    Code:
    #include <SDL.h>
    #include <stdio.h>
    
    int main(int argc, char *argv[]){
    
    }

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    48
    i just thought of something that could be the problem, if i am using cygwin 64 bit can that be the cause of the problem?

  6. #6
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Could you compile again and use --verbose please? Also it is rather important that you actually try to use the library:

    Code:
    #include <SDL.h>
    
    int main(int argc, char *argv[])
    {
       SDL_Init( SDL_INIT_EVERYTHING );
       SDL_Quit();
       return 0;
    }

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    48
    tried it and same problem

  8. #8
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I wanted to know what the compiler said. I need to know where it looked for SDL's files. Anyway, basically they aren't where they need to be.

  9. #9
    Registered User
    Join Date
    May 2008
    Posts
    48
    Quote Originally Posted by whiteflags View Post
    I wanted to know what the compiler said. I need to know where it looked for SDL's files. Anyway, basically they aren't where they need to be.
    it gave the exact same response as it had in my earlier showcase, nothing has changed , same response, same answer

    $ gcc sdl.c -lSDL
    sdl.c:1:17: fatal error: SDL.h: No such file or directory
    #include <SDL.h>
    ^
    compilation terminated.

  10. #10
    Registered User
    Join Date
    May 2008
    Posts
    48
    okay i have found the solution via some assisted help

    you need to actually build the files yourself from source for your compiler which means you need to download the source files and make & make install them for your compiler

    Using Cygwin for SDL Development | The No Quarter Arcade

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cygwin Help
    By wannabe723 in forum Windows Programming
    Replies: 10
    Last Post: 01-03-2009, 01:38 PM
  2. A.out in Cygwin
    By osal in forum C++ Programming
    Replies: 3
    Last Post: 03-08-2005, 01:21 PM
  3. G++ and Cygwin
    By osal in forum C++ Programming
    Replies: 4
    Last Post: 03-03-2005, 09:25 PM
  4. cygwin help
    By zell in forum Tech Board
    Replies: 1
    Last Post: 02-20-2005, 01:49 AM
  5. cygwin
    By studentc in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-16-2004, 01:15 PM