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]

C++ code with external C API --> static library?


Hi,

what are the necessary steps with gcc/g++ to solve the following
problem:
1. Target is a static library
2. The library presents a C language API
3. Internally, the library is implemented in C++ and makes
   heavy use of standard components from the stdc++ library
4. A user shall be able to use the library with gcc without
   having to know that the library is implemented in C++
   (i.e. the library must not reference unresolved C++ related
   symbols; all these symbols have to be resolved when the
   library is created).
5. Only symbols from the C language API are to be exported
   by the library. No internal symbols shall be visible.

(For step 2, I use the usual approach: #ifdef __cplusplus
extern "C" { #endif -- and the similar for the closing brace.)

Any suggestions?

Kind regards
    Ingolf
-- 

Ingolf Steinbach                       Jena-Optronik GmbH
ingolf.steinbach@jena-optronik.de       ++49 3641 200-147
PGP: 0x7B3B5661  213C 828E 0C92 16B5  05D0 4D5B A324 EC04


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