[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
C++ linked with other languages
- To: <bobp>
- Subject: C++ linked with other languages
- From: Roger Gregory <roger>
- Date: Mon, 18 Jun 90 15:20:39 PDT
- Cc: <markm>, <xtech>
A topic that has come up in comp.lang.c++ is linking c++ stuff
with other languages. The only thing that has come up that presents any
real problem is the matter of initializing static globals.
The initialization of static globals is accomplished in C++ by a post
ld pass that scans the name table of the linked file and generates
a initialization routine that it links in. The problem is that
users of another language, C for instance, won't have this final phase
lying around in a convenient way. The solution is to either have the C++
not use the offending construct, or to have it link in its own version
of the initialization stuff. This presents a minor problem in that it
requires the application to explicitly call an initialization routine,
but with all the other junk we have, this is a very minor thing.
I'm not sure how difficult it will be to do either of these alternatives,
both are possible, and were considered as fallback positions if some
platform proved recalcitrant, but this is a more direct and immidiate need.