[CMake] Mixing c and c++ with MinGW

Werner Smekal smekal at iap.tuwien.ac.at
Thu Dec 28 09:02:33 EST 2006


Hi,

it is normally possible to mix c and c++ in a project with the GNU 
compiler. Normally you compile c files with gcc and c++ files with g++ 
and than link all together with g++.

In our project (plplot) we allow c++ code into the mainly c code library 
under some circumstances - everything works fine, ar links everything 
together.

We have now c and c++ examples which use this mixed library, but the c 
examples won't compile with gcc obviously since a lot of c++ stuff is 
unreferenced.

I tried to set CC to g++, but cmake didn't allow this.

Is there any solution for this problem?

Thanks,
Werner

-- 
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: smekal at iap.tuwien.ac.at
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
        +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499


More information about the CMake mailing list