Mail Archives: djgpp/1997/12/01/01:46:39
If you need to compile this C code and later link it with C++ code, do this:
* Compile as C, make object files or a library file. Make header files.
Wrap the >header file declarations< in extern "C".
* Include header files in C++ source, link C++ object modules so generated
with the C object files.
This is done by the libc library itself: it is written in C, and if you
look at the headers (such as stdio.h) you see the extern "C" and how they
are used for this, and lastly, you'll notice libc functions like printf link
with C++ object code fine.
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -