[GCC-XML] MinGW gccxml-0.6.0

Brad King brad.king at kitware.com
Mon May 30 10:17:11 EDT 2005


Andrew McDonald wrote:
> I was able to build gccxml_cc1plus.

If you built this with the mingw compiler then this executable should 
not have problems with backslashes.

> but when I try a cpp file like this
[snip]
> I get ....
> 
> hello.cpp:2:19: no include path in which to find stdio.h
> void Hello::Print()
> hello.cpp:6: error: `printf' undeclared (first use this function)
[snip]
> Unfortunately the --print option is unrecognizeable for both the
> gccxml_cc1plus I built and the one from the windows installer.

There are two problems:

1.) You should not run gccxml_cc1plus directly.  Use the plain "gccxml" 
executable which internally runs gccxml_cc1plus.  The --print option is 
caught by this front-end and used to display the flags it will use to 
run gccxml_cc1plus internally.

2.) The "gccxml" front-end is responsible for determining the proper 
flags to simulate the desired compiler.  Although many compilers are 
supported, there is no support for determining the proper flags for 
MinGW's gcc automatically (yet).  You'll have to determine the flags 
manually and set them using the GCCXML_FLAGS option.

See this page:

http://www.gccxml.org/HTML/Running.html

to help set the option.  To determine the proper flags you'll have to 
run a command like this:

echo "" | gcc -x c++ -v -E -dM -

That will print out the internal include path and built-in definitions 
that your MinGW gcc compiler uses.  From that you have to construct a 
set of -I and -D options to include in GCCXML_FLAGS.  Finally you need 
to add an option -iwrapper"c:/path/to/GCC_XML/Support/GCC/3.3" that 
points at GCC-XML's internal support directory for the GCC version 
you're using.

-Brad



More information about the gccxml mailing list