[GCC-XML]cc1plus and gccxml

Brad King brad.king at kitware.com
Thu Sep 19 16:26:53 EDT 2002


> I have some throuble using gccxml,
>
> on a simple t.cxx
>
> gccxml --gccxml-executable /usr/local/bin/gccxml --gccxml-compiler
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/cc1plus --gccxml-root
> /usr/src/GCC_XML-0.2 t.cxx -fxml=out.xml
>
> while using directly the cc1plus ( -fxml able ) all works fine:
>
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.4/cc1plus t.cxx -fxml=out.xml
> -fxml-start=main

The gccxml-executable option is supposed to point at the gccxml_cc1plus
executable, and most of the time is not needed if the executables are next
to each other, or gccxml_cc1plus is in the path.  The gccxml-compiler
option points at the executable of the compiler you want to simulate with
GCC-XML (such as another version of GCC, or MipsPro, MSVC6, etc).  That
compiler's headers will be used, not GCC-XML's compiler's.

All you need from the build of the patched gcc 3.0.4 tree is the "cc1plus"
executable.  This should be copied next to the gccxml front-end executable
and renamed to "gccxml_cc1plus".  You don't need to install gcc-xml's
version of the compiler.  It will work with your system compiler, or any
compiler you specify (such as g++320).

Try this:

$ gccxml --gccxml-compiler g++ t1.cxx -fxml=out.xml

If the environment variable CXX or GCCXML_COMPILER is set then that
compiler will be used, and the gccxml-compiler isn't needed:

$ export CXX=g++
$ gccxml t1.cxx -fxml=out.xml

-Brad




More information about the gccxml mailing list