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
apparent reason.
I have spent a lot of research and experimentation into this subject
and have distilled my experiences in these texts.
The Document
The document is available in several formats.
Files
Some files that are used or referenced.
- 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
an application.
Or, you can simply download
tcl-c++.tar.gz
containing all of the above.
Frank Pilhofer
<fp -AT- fpx.de>
Back to the Homepage
Last modified: Fri Jun 1 17:46:56 2001