Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Mixed C/C++ sources under 3.0.2 and Environment variables

Hi all,

I'm having some trouble getting a CDT plug-in to work as I would like it
to. I'm running Eclipse 3.1.2 and CDT 3.0.2.

>From reading the thread 'Mixed C/C++ in MBS' it should be possible to
have a single compiler for .c and .cpp source files. Should this also
work under 3.0.2?

I've set the natureFilter for my compiler to 'both' and added an
inputType for the compiler that looks at .c and .cpp files. This does
allow a MBS project to attempt to build the C and C++ sources but the
compiler command line is invalid. The generated command line always
includes '../foo.cpp' as the last argument. So...

gcc -O0 -Wall -c -otest.o ../test.c ../foo.cpp
gcc -O0 -Wall -c -ofoo.o ../foo.cpp ../foo.cpp

Can anyone recommend the 'right' way of mixing C/C++ sources under CDT
3.0.2?

I also have a question about configurationEnvironmentSuppliers. We have
several versions of GCC installed but only want to use a specific one
when building via Eclipse. So I wrote an Environment Supplier which
prepends the PATH to use the appropriate gcc. This works when building
projects but the projects Includes folder has data from a different GCC
also installed on the system. I'd prefer to not update the actual system
PATH to always point to the special GCC. Any suggestions on how I could
guarantee that Includes folder data is pulled from the special GCC?

Thank you very much for any help or insights!
Matthias


Back to the top