Compiling
The C++/Tcl library consists of the following files:cpptcl.h
- to be#include
d in your own projects,
cpptcl.cc
- to be linked with your own projects,- a couple of additional files in the
details
directory - this directory should be visible on the include search path.
Note: The Boost library is used in a way that does not require its installation nor even compilation. It is enough to just download the Boost distribution and unpack it in a place where it will be found by the compiler.
Note: In its current version, the C++/Tcl library is not thread-safe in the sense that it should not be used in the multithreaded environment, where many threads can register new commands or use extended commands in scripts.
Unix, GNU/Linux
On Unix-like systems, the following command is enough to compile a one-file C++/Tcl program (shown for FreeBSD):$ g++ myprog.cc cpptcl.cc -o myprog
-I/usr/local/include/tcl8.4 -I/usr/local/include/boost_1_33_0
-L/usr/local/lib -ltcl84
Similarly, the following compiles a simple loadable shared module:
$ g++ mymodule.cc cpptcl.cc -shared -o myprog
-I/usr/local/include/tcl8.4 -I/usr/local/include/boost_1_33_0
Depending on the specific Unix system, it may be necessary to use different search paths.
Note also that a decent g++ compiler is necessary (in particular, g++ 2.95 or 2.96 will not work).
The
Makefile
s provided with test and example programs
should serve as good examples.