Topic: Libraries in C/C++
Author: hare@opal.xilinx.com (H.K. Verma)
Date: Thu, 23 Jun 1994 19:01:40 GMT Raw View
In article <2u798d$454i@argo.unm.edu>, rsahu@unm.edu (Raikanta Sahu) writes:
|> Is it OK to make a library using C compiler and link it with C++
|> compiled object files or vice versa?
|>
|> If not, how do the standard libraries like the math library work ?
Yes it is okay to link such libraries. However if a C function is
being used in a C++ program, The linkage directive
extern "C" (function name)
must be given in C++ program. The default linkage is extern "C++".
Author: rsahu@unm.edu (Raikanta Sahu)
Date: 21 Jun 1994 11:50:05 -0600 Raw View
Is it OK to make a library using C compiler and link it with C++
compiled object files or vice versa?
If not, how do the standard libraries like the math library work ?
Thanks.
-Raikanta
Author: p150651@cc.tut.fi (Pulkkinen Esa)
Date: 22 Jun 1994 01:29:57 GMT Raw View
In article <2u798d$454i@argo.unm.edu> rsahu@unm.edu (Raikanta Sahu) writes:
Is it OK to make a library using C compiler and link it with C++
compiled object files or vice versa?
If the two compilers are from the same supplier, then it should be ok to
use libraries from both C and C++ compiler in the same project. The
C++ language supports this by the 'extern "C" <prototype>'-construct, i.e.
all routines shares between C and C++ must be defined in the C++ program
using it. But IMHO at least the ARM doesn't require a C++ implementation to be
object-code compatible with C-implementations, although it's recommended, and
All C++-compilers I've seen have supported it.
---
Esa Pulkkinen | Disclaimer:
E-Mail: esap@cs.tut.fi | These opinions are mine, so
WWW : http://www.cs.tut.fi/~esap/ | don't blame others on them.