Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SDL.h: no such directory found

4: Adsense

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 GTEgares   Members   

807
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 fastcall22   Moderators   

10700
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.

zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

#3 GTEgares   Members   

807
Like
0Likes
Like

Posted 29 June 2014 - 01:37 PM

yeah i tried that


~GTE


#4 rip-off   Moderators   

10897
Like
3Likes
Like

Posted 29 June 2014 - 01:55 PM

Have you installed SDL? If so, how?

#5 fastcall22   Moderators   

10700
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).
zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

#6 LAURENT*   Members   

767
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 GTEgares   Members   

807
Like
0Likes
Like

Posted 29 June 2014 - 02:14 PM

Guys thanks I fixed the issue


~GTE


#8 Bacterius   Members   

13164
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 KotoR`eZ   Members   

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 KotoR`eZ   Members   

357
Like
0Likes
Like

Posted 29 June 2014 - 05:18 PM

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

#11 Sik_the_hedgehog   Members   

3002
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.