Thread: Cannot open include file: 'SDL/SDL.h': No such file or directory

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    132

    Cannot open include file: 'SDL/SDL.h': No such file or directory

    I'm trying to compile the .c program from Lazy Foo' Productions - Hello SDL: Your First Graphics Window from the Developer Command Prompt for VS2013, with the following command:

    cl test.c /Wall /link "C:\SDL2\Development Libraries\SDL2-2.0.3\lib\x86" /I "C:\SDL2\Development Libraries\SDL2-2.0.3\include"

    But, I'm getting the following error:

    "fatal error C1083: Cannot open include file: 'SDL/SDL.h': No such file or directory"

    How can I solve this? Thanks in advance.
    Last edited by stdq; 05-11-2015 at 05:29 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,972
    Check that "C:\SDL2\Development Libraries\SDL2-2.0.3\include" actually exists, that it contains a directory called SDL, which in turn contains a file called SDL.h

    Assuming you installed the library OK, the only thing that usually goes wrong is getting the wrong search paths.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    132
    Thanks for your reply. The directory is correct, I copied it from the explorer.

  4. #4
    Registered User Alpo's Avatar
    Join Date
    Apr 2014
    Posts
    877
    My version of 2.03 has the SDL.h file directly in the include directory. Try removing the "SDL/" from <SDL/SDL.h>.
    WndProc = (2[b] || !(2[b])) ? SufferNobly : TakeArms;

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    132
    Thanks. I tried that too.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    3,824
    What directory holds the SDL.h file?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    Registered User
    Join Date
    Oct 2010
    Posts
    132
    Thanks, stahta01. The directory is "C:\SDL2\Development Libraries\SDL2-2.0.3\include".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cant open file - says no file or directory
    By sdsjohnny in forum C Programming
    Replies: 3
    Last Post: 07-02-2010, 10:57 PM
  2. Replies: 6
    Last Post: 04-30-2010, 06:13 PM
  3. Cannot open include file: 'stack.h'
    By GSalah in forum C++ Programming
    Replies: 7
    Last Post: 01-02-2007, 03:18 PM
  4. Cannot open include file
    By SeanMSimonsen in forum C++ Programming
    Replies: 5
    Last Post: 04-02-2003, 07:33 PM
  5. Where can i add a header file other than include directory
    By asdfasdfasdf in forum C++ Programming
    Replies: 4
    Last Post: 09-26-2002, 07:23 AM

Tags for this Thread