Alex Rivera | Logout

Visual Studio cannot include header file.

Asked 2012-09-24T08:04:14.940
21

Visual studio projects have a folder for header files. So, I put the header file in there thinking I would be able to type #include "SDL.h", but that didn't work. I did some searching for it and found nothing helpful.

error

Edit
Report

1 Answer

42

Putting the header there only helps organize your files, it doesn't copy the file to the include directories nor makes it automatically visible.

You'll need to add the path to where SDL.h is located to your project additional include directories.

Just right-click on the project -> Configuration Properties -> C/C++ -> General -> Additional Include Directories.

In fact, you shouldn't have to add SDL.h to the solution, having the path in the Additional Include Directories is enough.

answered 2012-09-24T08:05:19.843

Your Answer