Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Mixed C/C++ in MBS

>>>>> "Leo" == Treggiari, Leo <leo.treggiari@xxxxxxxxx> writes:

Leo> 1.  Do you always want to compile source with C extensions with the C
Leo> compiler and sources with C++ extensions with the C++ compiler?

Yes.

Leo> 2.  What about the linker to use?  With mixed C/C++ is it always the C++
Leo> linker?

Yes.

In Automake what we do is, if the project only has C files, we use the
C compiler driver to link.  If we see a C++ source file, we use the
C++ driver to link.  There are similar rules for Fortran and Objective
C.  I forget what we do if we see an odd mix of languages (like, C +
ObjC + Fortran) -- probably just punt.

This seems to work well for most situations.

We also let the Makefile.am author (in Eclipse this is just the user)
override the linker setting on a per-executable basis.  This allows
for unusual situations.

Tom


Back to the top