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

10 replies to this topic

### #1GTEgares  Members

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/xkJLco5.png

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

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

~GTE

### #2fastcall22  Moderators

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

### #3GTEgares  Members

Posted 29 June 2014 - 01:37 PM

yeah i tried that

~GTE

### #4rip-off  Moderators

Posted 29 June 2014 - 01:55 PM

Have you installed SDL? If so, how?

### #5fastcall22  Moderators

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

### #6LAURENT*  Members

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.

### #7GTEgares  Members

Posted 29 June 2014 - 02:14 PM

Guys thanks I fixed the issue

~GTE

### #8Bacterius  Members

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

### #9KotoReZ  Members

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:

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

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.

### #10KotoReZ  Members

Posted 29 June 2014 - 05:18 PM

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

### #11Sik_the_hedgehog  Members

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.