Jump to content

  • Log In with Google      Sign In   
  • Create Account

SDL.h: no such directory found


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
10 replies to this topic

#1   Members   -  Reputation: 803

Like
0Likes
Like

Posted 29 June 2014 - 01:03 PM

I set up SDL on my compuer with Code Blocks. But There was an error that said: "fatal error: SDL.h: No such file or directory"

 

Here an image of the error: http://i.imgur.com/4fvBNFw.png

 http://i.imgur.com/aPGmZT2.png

http://i.imgur.com/xkJLco5.png

http://imgur.com/aPGmZT2,xkJLco5,kEgaRqg#2


Edited by GearTreeEntertainment, 29 June 2014 - 01:07 PM.

~GTE


#2   Moderators   -  Reputation: 9437

Like
3Likes
Like

Posted 29 June 2014 - 01:34 PM

Quickfix:
#include "SDL/SDL.h"

Double check your directories; you've a search directory, "C:\Users\sarmeanu\DOCS\SDL\include\", but SDL.h is located at "C:\Users\sarmeanu\DOCS\SDL\include\SDL\SDL.h".

Edited by fastcall22, 29 June 2014 - 01:35 PM.

gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#3   Members   -  Reputation: 803

Like
0Likes
Like

Posted 29 June 2014 - 01:37 PM

yeah i tried that


~GTE


#4   Moderators   -  Reputation: 10604

Like
3Likes
Like

Posted 29 June 2014 - 01:55 PM

Have you installed SDL? If so, how?

#5   Moderators   -  Reputation: 9437

Like
4Likes
Like

Posted 29 June 2014 - 01:56 PM

http://i.imgur.com/kEgaRqg.png


... Uhh, those should be lower case Ls, not pipes |... See GCC link options. Pipes are used to pipe output from programs elsewhere (to a file, another program, etc).
gzip: H4sIAAAAAAAEAG1QTUvEMBC991e8nvaiFfYoS7yo sLCo6MnjtJ1ugmkiyWRL/72z3T1YEQIJ8z4zA2Xp yPvt1qBpGrRFIJZkk9FyRyUzHCbKIHgn4hnZOrm1 TD0mG0HCCs+QGDGWziKXI6Wm2n++GYwUVH2mrGEE PnGCVQ8K8+JYfXA6URDEQfMZh5h6g5eoAlWJdeEI bbH2qYZf7XMUfw8f/Q0oMeZYNL9/WHF0uFEshvMr XYujd9SycFb+F18QcSOvlJauZ8ejqevdnV7/d550 e0t6prmunh73Bu+vz4c/XUeOQXfJgvKNkhf95U8/ Dtgmy5IBAAA=

#6   Members   -  Reputation: 541

Like
0Likes
Like

Posted 29 June 2014 - 02:13 PM

Um.... Did you put a. copy of the SDL.lib in the same folder as the exe file? I think you find it in the lib folder.



#7   Members   -  Reputation: 803

Like
0Likes
Like

Posted 29 June 2014 - 02:14 PM

Guys thanks I fixed the issue


~GTE


#8   Crossbones+   -  Reputation: 13028

Like
1Likes
Like

Posted 29 June 2014 - 03:58 PM

Guys thanks I fixed the issue

 

Care to share, just so this thread isn't totally useless and other people coming across it in the future can hope to fix their problem too?


Edited by Bacterius, 29 June 2014 - 03:58 PM.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#9   Members   -  Reputation: 357

Like
0Likes
Like

Posted 29 June 2014 - 05:10 PM

Here is my folder structure:

C:\SDL2\bin
include
lib

These folders came from "i686-w64-mingw32" not "x86_64"
Codeblocks setup:
Linker settings -> other linker options: -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer

Search directories - Compiler:
C:\SDL2\include\SDL2
C:\SDL2\SDL2_image-2.0.0\i686-w64-mingw32\include\SDL2
C:\SDL2\SDL2_mixer-2.0.0\i686-w64-mingw32\include\SDL2

Search directories -Linker:

C:\SDL2\lib
C:\SDL2\SDL2_image-2.0.0\i686-w64-mingw32\lib
C:\SDL2\SDL2_mixer-2.0.0\i686-w64-mingw32\lib

//main.cpp
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>

Should work perfectly fine.

#10   Members   -  Reputation: 357

Like
0Likes
Like

Posted 29 June 2014 - 05:18 PM

I give up editing my post. It keeps changing characters for me... :(

#11   Crossbones+   -  Reputation: 2839

Like
0Likes
Like

Posted 29 June 2014 - 09:01 PM

Quickfix:
#include "SDL/SDL.h"

Double check your directories; you've a search directory, "C:\Users\sarmeanu\DOCS\SDL\include\", but SDL.h is located at "C:\Users\sarmeanu\DOCS\SDL\include\SDL\SDL.h".

Note that it's SDL2/SDL.h in the case of SDL 2.0 (saying this in case somebody else looks at that post).

 

And yeah, that seems to cause trouble a lot of time. The documentation insists that one should use "SDL.h", but I have tried that in the past and the compiler becomes unable to find the header. In the end I use <SDL2/SDL.h> and it works just fine. I think the issue is that the documentation assumes you're using pkg-config (which will add the SDL headers directory to the include list).


Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS