3

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
Verhogen
  • 27,221
  • 34
  • 90
  • 109

2 Answers2

5

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.

wilhelmtell
  • 57,473
  • 20
  • 96
  • 131
0

In Visual studio, you can also define include folders by setting them via Options/File Locations. Then you don't need to repeat them in every project setting. (Assuming that's what you're after). It is a bit weird to define absolute paths in source code, you'll never know from which folder/drive a build is run.