This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking C and C++ together


Dear GCC-team,

I want to use both C and C++ in a program (unfortunatly, the C source isn't
compatible with C++), and therefore I must compile the C files with "-x c"
(otherwise I get lots of errors, due to old-style function definitions).
This works just fine, but when I try to link both objects together, C++ doesn't
find the C functions and the other way round! (undefined reference)
May this be because I use an older cygwin-version of GCC (3.3.3)? Is there any
work-around (e. g., allowing C code to be compiled into C++ compatible objects)?
I looked through the manual, but I wasn't able to find a solution...

Many thanks,
Daniel Kraft


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]