Search code examples
c++visual-studio-2010includedirectorypragma

C++ Specify Headers Include Directory in Code


Is there a way to specify include directories in the code, perhaps via a #pragma?

I have my project setup as "src/" and "include/" folders. I am trying to compile in Visual Studio 2010, but I don't want to set it up in the project settings.

Is there another way to allow it to compile instead of having to specify the include as

#include ../include/ss.h

Solution

  • The Correct(tm) way to specify search directories is with compiler flags. In Visual Studio you do this by playing with the project settings, or its compiler's /I commandline parameter.