Making C++ Loadable Modules Work
A question frequently popping up on comp.lang.tcl is why loadable
modules written in C++ ``won't work''. Sometimes, they refuse to link,
others refuse to load, and some link and load, but then crash for no
I have spent a lot of research and experimentation into this subject
and have distilled my experiences in these texts.
The document is available in several formats.
Some files that are used or referenced.
Or, you can simply download
containing all of the above.
- module.cc A sample module that we want
to load dynamically.
- tclAppInit.c Slightly modified so
that it can be compiled with a C++ compiler. Necessary on HP-UX
using CC or aCC.
- global.c An initialization function that
g++'s ``collect2'' produces for example on HP-UX when linking
an application. FYI only, you don't need this.
- ctor.c A table of global constructors that
g++'s ``collect2'' produces for example on Ultrix when linking
<fp -AT- fpx.de>
Back to the Homepage
Last modified: Fri Jun 1 17:46:56 2001