visual studio not seeing my include files

Diego Fernando Pava picture Diego Fernando Pava · Aug 11, 2016 · Viewed 19.2k times · Source

This may be a very simple question but I haven't been able to figure it out so any help is appreciated.

I have a header that is located in a general folder because I want to use it in several projects for example:

C:\user\geninclude\program\header.h

I created a new empty project with a very simple main, in the main I put

#include <program/header.h>

I then went to the project properties and in VC++ in include directories added C:\user\geninclude\

but when I tried to build the program the program tells me it cannot find header.h because is not in the current directory or in the build system path.

I also tried in the project properties in C/C++ general Additional Include Directories adding C:\user\geninclude\ but still the same error.

I know is something simple I am missing, but I don't know what, I am very new to this just learning.

For reference I am using Visual Studio 2013.

Thank you in advance for your help.

UPDATE: Thank you all for your kind responses, I have tried everything you have told me (check release vs debug in both instances, change / for \ and <> for "", and double checking the header and still the system does not see it. It really is very weird. I'll keep trying...

Answer

RubenC picture RubenC · Aug 12, 2016

Please check if your file is really an header file otherwise it won't appear on include.

What you can also do (as a workaround if you need that method fast) is to put your header file (or folder with header files) on the visual studio "include" folder. The path should look like this "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"

PS: You should also check the properties configuration when you're adding the path to VC++ include directories. You could be adding the path to debug configuration and trying to run it in release mode.