[Richard Suchenwirth] 2004-11-23 - The very generic name stands for "A [C++] library for interoperability between C++ and [Tcl]" by [Maciej Sobczak], based on the Boost project. On [SourceForge] it goes under the name '''cpptcl''' at http://cpptcl.sourceforge.net/. [LV] So is this cpptcl different from what is documented on this wiki page - [cpptcl]? [RS]: Yes - that's the risk with too-generic names... The software I discuss here was only announced on 2004-11-22, but looks pretty powerful. It "was inspired by the Boost.[Python] library and was designed to provide a similar interface"... "The C++/Tcl library depends on the Tcl core library and on the Boost library (see http://www.boost.org/ ). Any recent version of these two should work fine." The documentation (one could also call it a tutorial) makes a good impression - it looks as if combining C++ and Tcl, both for making shared libraries and embedded interpreters, go very easy, for instance compared to [SWIG]. Here's (untested, but drawing from the documentation) how to make a shared library with two commands (that both are served by the same C++ function): #include "cpptcl.h" int sum(int a, int b) {return a + b;} CPPTCL_MODULE(Example, i) { i.def("add",sum); i.def("+",sum); } ---- $ tclsh % load ./example.so % + 3 4 Has anybody made practical experiences with this? Especially on [Windows]? According to the Boost site, it should be possible. ---- [MAK] (11 Oct 2004) - Looks very interesting. The code (both for cpptcl its self and how you use it) seem very nicely compact. cpptk also looks very interesting. I'm curious how much overhead the Boost library would add, though; I'll have to look into that. Two things I don't see from the documentation, though: 1. What's the license? 2. How would you create a function that can take a variable number of arguments (a la widget configuration parameters)? ---- [snichols] The documentation looks very strait forward. So, I thought I would try compiling the hello example Tcl extension for Windows. However, there are some header files and library dependencies, and I do not know where to get these. Its looking for something called boost/shared_ptr.hpp and a couple other dependencies. - [RS]: Scott, that dependency on Boost from http://www.boost.com/ is documented even on this page :^) [snichols] Thanks for the info on Boost. I'll try including the headers and give the hello example another try. I think I would have use for this. It appears to simplify some of the Tcl to C++/C library programming and would be handy for small C++ Tcl extensions, like ones I have written in the past. [snichols] Ok, this is what I have found out compiling the sample hello world C++/Tcl extension under Windows. The code will not compile with Visual Studio 6 because of this error, "template class has already been defined as a non-template class." Microsoft has confirment there older VC++ 6.0 compiler does not compile this, but there new 2003 C++ compiler does. So,I download and installed the Microsoft C++ 2003 Toolkit to compile this. It does compile ok, but I get the following error when linking: main.obj : error LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class exception const &)" (?throw_exception@boost@@YAXABVexception@@@Z) referenced in function "public: __this call boost::detail::shared_count::shared_count *,struct boost::checked_deleter > >(class Tcl::details::callback0 *,struct boost::checked_deleter >)" (??$?0PAV?$callback0@X@details@Tcl@@U?$checked_deleter@V?$callback0@X@details@Tcl@@@boost@@@shared_count@detail@boost@@QAE@PAV?$callback0 @X@details@Tcl@@U?$checked_deleter@V?$callback0@X@details@Tcl@@@2@@Z) main.exe : fatal error LNK1120: 1 unresolved externals Thanks in advance. Once, I get through the link error, I feel confident I can port some of my previous Tcl C++ extension to use this. ---- [Maciej Sobczak] - The C++/Tcl library depends on some of header-only Boost libraries. This means that it is enough to download Boost, unpack it somewhere and add that path to the compiler's include search path. No compilation of Boost is required. The license is stated in each source file, but will be soon stated more explicitly. It is extremely permissive, anyway. // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. ---- [Robert J. Peters]' [GroovX] [http://www.klab.caltech.edu/rjpeters/groovx/] package makes for an interesting comparison [http://groups.google.com/groups?selm=6gwtwcmhgp.fsf%40goethe.klab.caltech.edu]. ---- [Category Language]