Solved

INCLUDE directories in Visual C++ 5 - How to set up relative paths

Posted on 1997-06-20
2
1,210 Views
Last Modified: 2013-11-18
I have a lot of projects (dlls and exes) that I am porting from 16-bit to 32-bit Windows.  For historical reasons, most have source files in a subdirectory and header files in another.  I therefore used to have my INCLUDE environment variable set to something like:

.\include;.\resource;etc.

to pick up these subdirectories.  I also added these to my Options/Directories line in VC++ 1.52.

However, in VC++ 5, it automatically converts these relative paths in my INCLUDE environment variable into absolute ones, and does this relative to the executable directory, so I
get an include search path of:

f:\program files\devstudio\vc\bin\include  and
f:\program files\devstudio\vc\bin\resource !!!

If I go to Tools/Options/Directories and enter a relative path, it just converts it to an absolute one based on the current project direcory, which is fine for that project, but then when I switch projects it points to the wrong place (since it is not a project- but a global-setting).

Any ideas of how to get around this?  At the moment I have two entries (include and resource) in the Directories dialog for each of my (many) projects, and I reorder them depending on which project I am building - a real pain.

Any help would be greatly appreciated.
0
Comment
Question by:rpb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
jmmougeolle earned 100 total points
ID: 1163995
In fact you did it wrong, there is several ways to add include path, one way is to add it globally (and that's the one you used) by using the Options/directories Dialog Box.
The other one (and that's what you got to do in your case) is to use the "Project/Settings/C/C++/Preprocessor/additional include directories" place. That will add a path locally to a project.

Global settings gotta work for any project, besides his place, so it's why you cant use in it relative path.... but that's not the case for the Project Settings.

Another way could also be to just use Nmake and not Visual to compile and change the INCLUDE var as you want it to be...


0
 

Author Comment

by:rpb
ID: 1163996
Thanks - that did the trick!  (What an obvious place for that setting!!!)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
use of cookies and regulations 1 103
sorting efficency of sorting algorithm 30 131
site launch date and last modified date 3 105
Precision Problem in C++ 7 50
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question