Connecting Tech Pros Worldwide Forums | Help | Site Map

relative paths in VS 2003?

Joe
Guest
 
Posts: n/a
#1: Nov 17 '05
Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have
some source with a tree directory structure that segments include files in
various directories:

#include "../include/config.h" /* Keep this first */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../include/complex.h"
#include "../include/su3.h"

Can someone tell me how to set up vc++ for this? I basically set up vc++ to
open a new project with location in the directory where the main.cpp is
held. It is from there that the include relative paths should be taken from.
But vc++ doesnt seem to recognise them:

fatal error C1083: Cannot open include file: '../include/config.h': No such
file or directory

can someone tell me how to fix this?

On another nots, where have the project options gone to? I was on a earlier
version of vc++ and have moved onto 2003. Things are a little differennt.

thanks!
Joe



Carl Daniel [VC++ MVP]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: relative paths in VS 2003?


Joe wrote:[color=blue]
> Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I
> have some source with a tree directory structure that segments
> include files in various directories:
>
> #include "../include/config.h" /* Keep this first */
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> #include "../include/complex.h"
> #include "../include/su3.h"
>
> Can someone tell me how to set up vc++ for this? I basically set up
> vc++ to open a new project with location in the directory where the
> main.cpp is held. It is from there that the include relative paths
> should be taken from. But vc++ doesnt seem to recognise them:[/color]

Relative paths will be tried relative to all the paths listed in the
Tools|Options|VC++ Directories|Include paths as well as Additiional Include
paths set in project properties, and relative to the location of the source
file containing the #include directive.
[color=blue]
>
> fatal error C1083: Cannot open include file: '../include/config.h':
> No such file or directory
>
> can someone tell me how to fix this?
>
> On another nots, where have the project options gone to? I was on a
> earlier version of vc++ and have moved onto 2003. Things are a little
> differennt.[/color]

Property properties. What were you looking for in particular?

-cd


Ashish Kaila
Guest
 
Posts: n/a
#3: Nov 17 '05

re: relative paths in VS 2003?


Hi Joe,
I usually add different folders in the Include file path pane of the project
properties. Then you can just specify header file name in quotes (w/o rel
path) and things will compile.
HTH
Ashish

"Joe" <Joe@tim.com> wrote in message
news:%23Gm8lzrzEHA.1860@TK2MSFTNGP15.phx.gbl...[color=blue]
> Hi, can someone tell me how to set up relativ paths in VS2003 C++ ? I have
> some source with a tree directory structure that segments include files in
> various directories:
>
> #include "../include/config.h" /* Keep this first */
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> #include "../include/complex.h"
> #include "../include/su3.h"
>
> Can someone tell me how to set up vc++ for this? I basically set up vc++[/color]
to[color=blue]
> open a new project with location in the directory where the main.cpp is
> held. It is from there that the include relative paths should be taken[/color]
from.[color=blue]
> But vc++ doesnt seem to recognise them:
>
> fatal error C1083: Cannot open include file: '../include/config.h': No[/color]
such[color=blue]
> file or directory
>
> can someone tell me how to fix this?
>
> On another nots, where have the project options gone to? I was on a[/color]
earlier[color=blue]
> version of vc++ and have moved onto 2003. Things are a little differennt.
>
> thanks!
> Joe
>
>[/color]


Closed Thread