tmighty
tmighty

Reputation: 11399

Defining relative Include path

In the Project Properties page under VC++ directory, I can add include directories.

2 questions about it:

  1. When I use the "..." button to locate a directory, Visual Studio adds the absolute path, let's say "c:\include". Why does it use an absolute path by default and not a relative one? This would make moving the project to another location or another computer easier.

  2. How would I define a relative path? I tried "\include", but that wouldn't work: No explicit error message, but missing Include files during compiling.

Upvotes: 0

Views: 648

Answers (1)

alangab
alangab

Reputation: 867

Visual Studio offers different ways to specify include directories to render the projects portable.

If you use a relative path, the starting directory is the project directory. build the relative path starting from this. Following your sample, you have to specify "..\include"

You can also define a configuration per user, using Property Manager and edit the Microsoft.Cpp.Win32.User configuration. You find Property Manager in "View" Menu. ( VS2010)

Upvotes: 1

Related Questions