Hi Sam, * Adams Samuel D Contr AFRL/HEDR wrote on Wed, Sep 07, 2005 at 04:22:25PM CEST: > I am writing a new program in C++ as it can use complex numbers and C does > not have that functionality, but I am also trying to use a C library that I > wrote before for another program that handles all of the data. It seems > that g++ has to compile the C code in order for it to be able to link the > object files and not gcc. But, automake tries to compile c code with gcc > and c++ code with g++, but then linking breaks. Is there some kind of > directive that I need to put in the configure.ac to get this to work, or > what am I not understanding?
No, in general it should not be necessary to compile the C code with a C++ compiler in order to link both together. A couple of things to check: did you declare the C functions as `extern "C"' for C++? Does the link line Automake creates use the C++ compiler (g++) to link? If not, please post a representative part of Makefile.am to show how you use it. Also, do you use a recent Automake version? Which one? What kind of link errors do you see (post the first few of them)? BTW, reading info Automake "Mixing Fortran 77 With C and C++" and/or posting a reproducible example helps a lot. :-) Cheers, Ralf
