RE: C/C++ mixing during linkage

New Message Reply Date view Thread view Subject view Author view

From: Tomlinson, Gordon (GORDON.TOMLINSON++at++ca.com)
Date: 10/27/2001 10:30:07


Hi

I assume you are rapping the C++ functions with extern "C" if you do no do this then name mangling will get you
Also I would change you main file to CC and make sure you invoke the C++ compiler and linker rather than C
extern "C" {

function x(){ } .....
}

Regards

Gordon.
_________________________________________________________________
Gordon Tomlinson

Manager
Urban Simulation Products Engineering.

MultiGen-Paradigm
"a Computer Associates Company"
Suite 200, 16415 Addison Road, Addison, TX 75001 USA

Tel: 972 380 9798 ext 309 Fax: 972 380 9468

Email: gordon.tomlinson++at++ca.com

-----Original Message-----
From: Devrim Erdem [mailto:devrim++at++vires.com]
Sent: Saturday, October 27, 2001 11:00 AM
To: info-performer++at++sgi.com
Subject: C/C++ mixing during linkage

Hi,

My platform : Linux, Suse 7.1, Pf 2.4.2

I have an assumption. I have a performer application written in C. I
also have some code written in C++ with header files C compatible (
doesn't contain anything C++ ) . I assumed that I could link C++ and C
objects files to build the Performer application. Via the C header files
main.c (a C source code ) is calling functions which are implemented in
C++.

The problem is that the linker can not resolve the functions implemented
in C++. On IRIX I had to inform the linker about the C++ objects and
that would allow me to link C and C++ objects. I have gone thru the man
pages of gcc and ld but I can not see anything specific. Any
ideas/experiences ?

Thanks in advance.

Devrim Erdem

-----------------------------------------------------------------------
   List Archives, Info, FAQ: http://www.sgi.com/software/performer/
   Open Development Project: http://oss.sgi.com/projects/performer/
                Submissions: info-performer++at++sgi.com
            Admin. requests: info-performer-request++at++sgi.com
-----------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Oct 27 2001 - 10:36:02 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.