automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing C and C++


From: Paul F. Kunz
Subject: Re: Mixing C and C++
Date: Wed, 7 Sep 2005 08:15:46 -0700

>>>>> On Wed, 7 Sep 2005 09:22:25 -0500 , Adams Samuel D Contr AFRL/HEDR 
>>>>> <address@hidden> said:

> 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?

   Are the C header files wrapped with extern C like this ...

#ifdef __cplusplus
extern "C" {
#endif

with the appropriate closing brace?   This tells the C++ compiler that
the declared functions use C linkage and thus  not to assume function
name overloading.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]