[GCC-XML] Relative paths in GCCXML

Chris Friedemann chrfried at gmail.com
Tue Sep 25 18:28:34 EDT 2007

Yeah, I'm positive that the relative path exists from the files location.
To make 100% sure, I whipped up a little test.  If you create a file like


#define SOME_CONSTANT = 1;

And then create another file like this:


//#include "../testA.h"
//#include "c:\xmlTest\testA.h"


Save both of them, and create a folder inside of another folder.  Place
testA.h in the first folder, and testB.h in the second folder.  If you
uncomment the first #include, you get a "cannot find file" error.  If you
uncomment the second include (and you fix it for the actual paths of the
folder you created) then it will work.

I'll freely admit I'm not the best at this kind of thing, but I'm pretty
sure it should work no matter which one you uncomment.  Did I make a stupid
mistake somewhere or am I missing something?

On 9/25/07, Brad King <brad.king at kitware.com> wrote:
> Chris Friedemann wrote:
> > Sorry, I guess I should have been more clear.
> >
> > What I'm confused as to if I run gcc-xml on a .h file that has an
> > include preproccesor definition that contains a fully specified path
> like:
> >
> > #include "C:\dev\dirA\dirB\dirC\header.h"
> >
> > then it works without using the -I flag at all.
> >
> > However, if the path is not fully specified like this:
> >
> > #include "../../dirC/header.h"
> >
> > then I get the "could not find file header.h" error message.  Neither of
> > these examples use the -I flag, but one works and the other doesn't.
> > I'm just curious as to the reason why.
> Where is the input .h file in your example?  Does the
> "../../dirC/header.h" file exist relative to its location?  If not, then
> "../../dirC/header.h" must exist relative to a directory specified with
> -I.  This is standard on all compilers.
> -Brad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/gccxml/attachments/20070925/218d76c9/attachment-0001.html>

More information about the gccxml mailing list