View topic - C/C++ shared lib linking prob

C/C++ shared lib linking prob

anything that doesn't fit to other groups.

C/C++ shared lib linking prob

Postby starless » Tue Sep 30, 2003 7:21 pm

I'm a user of the Momentics IDE. Is it normal that C apps can't link against C++ shared libs, and vice versa? I can't find a way to make it work.
Active Member
Posts: 70
Joined: Sun Sep 21, 2003 1:15 am

Postby thegman » Wed Oct 01, 2003 4:31 pm

I *think* you can generally link C libs to a C++ prog, but not C++ libs to C apps, as there is stuff in C++ that simply does not exist in C so you won't be able to use the functions anyway. Don't quote me though!

Senior Member
Posts: 439
Joined: Sun Jun 15, 2003 8:10 pm

Postby cdm » Thu Oct 02, 2003 5:16 am

The only way you can link against a C++ lib with a C app is if your C app only calls functions in the C++ library that are declared..

extern "C"

...otherwise the naming conventions won't match.
QNX Master
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Return to General Programming

Who is online

Users browsing this forum: No registered users and 2 guests