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]

Re: Can C and C++ object files be linked into an executable?


Ray Hurst writes:
 > Hi,
 > I have a code that is compiled in C and I need to link in C++ object 
 > files. I need to know if C++ object files created with a C++ compiler 
 > can be linked with C object files created with the C compiler.
 > 
 > I have never attempted this. I have either written the entire project in 
 > C or C++. I have mixed C code with C++ code by placing the C code in a 
 > namespace. I have also interfaced C++ code to C code by createing a C 
 > wrapper for the C++ object but everything was compiled with an C++ compiler.

I'm sure this is in the Book.  Section 9.2.3 3rd. Ed, "Linkage to
non-C++ code."

Andrew.


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