Public Group

# SDL.H no such file or directory WHAT DA ????

This topic is 4901 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i installed SDL and im using VC 6 ive read all the docs and html info on how to install it everything seems fine but ! when i compile it always says " sdl/sdl.h no such file or directory " and yes i did put the path in the include dir and also pointed to the library and added the .dll in windows/system none of the example codes ive downloaded will work because of this can someone help me please ??? thanks a lot mates !

##### Share on other sites
just try doing

#include "sdl.h"

instead of sdl/sdl.h unless you actually put the sdl.h file in a folder called /sdl

##### Share on other sites
yes ive tried that... and creating a c:sdl/sdl dir

##### Share on other sites
About the libraries.. Did you include both SDLmain.lib & SDL.lib in the project?

##### Share on other sites
I've been having something of a similar problem, although it's with Dev C++.

With Dev C++, it's a slightly different ordeal, and my solution has been lately just to download the silly devpaks and install it that way. Buuuuuut. I digress.

Check to make sure SDL is extracting all it's respective folders (include, bin, lib I believe are the most important ones) in the right areas. What your path is going to want to link up with, I'm sure, is the 'include' path. That's the folder with SDL.h. There's still some extra stuff you'll have to do to initialize a project for VC6, and that's best explained here.

http://sol.gfxile.net/gp/ch01_vc6.html

From there, either #include "sdl.h" or #include "sdl/sdl.h" should work. *should*.

If you've already done this, sorry, I'm just checking the most possible errors. :)
It doesnt' help that I have no experience with VC6, either. Hope this helps you!

##### Share on other sites
I would suggest this:

1. Make sure the file is physically where you are asking the compiler to look for it
2. Use angle brackets - #include <SDL/SDL.h>
3. Try a backslash - SDL\SDL.h I don't know how VC uses these, so don't blame me for putting in a possibly worthless suggestion.

##### Share on other sites
Quote:
 Original post by deavik2. Use angle brackets - #include

If I recall correctly, angle brackets instruct the compiler to search the system includes and any location the compiler sees fit. Although many compilers will actually find the requested header (since the specified include-dirs are included in the search), quotation marks are the most correct here, I believe.

##### Share on other sites
Hold on a second there, where exactly are you putting sdl.h?

##### Share on other sites
Yes, if you use <> then the system will look in all directories included in the project setup.

Make sure you've added the directory containing your SDL.h into your project options. Also make sure you do the same for the libs. To include individual libraries you do
#pragma comment(lib,"libname.lib")

##### Share on other sites
I've had the same problem when I go to try a SDL tut, but when I put this header in,

#include <stdio.h>
#include <stdlib.h>
#if defined(_MSC_VER)
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif

I have no problems. Hope this helps.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 29
• 16
• 11
• 10
• 11
• ### Forum Statistics

• Total Topics
634112
• Total Posts
3015584
×