如何使用C ++扩展TCL? [英] How to extend TCL with C++?

查看:181
本文介绍了如何使用C ++扩展TCL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以编写一个可以编译并用于扩展TCL的C ++代码吗(我不是说要调用一个可执行文件)?我可以通过调用已编译的(.so或.a文件)C ++代码在TCl代码中描述某些类,函数并将其用于它们吗?如果是的话,请示意性地向我解释它的完成方式.

Can I write a C++ code that can be compiled and used for extending TCL (I don't mean calling an executable file)? Can I describe some classes, functions and use them for in my TCl code by calling the compiled (.so or .a file) C++ code? If yes, then please explain me schematically how it is being done.

推荐答案

http://cpptcl.sourceforge.net/这是Tcl C API的C ++包装器,使用非常方便,有据可查.我从我的亲身经历告诉我.

http://cpptcl.sourceforge.net/ It is a C++ wrapper of Tcl C API and very convenient to use, well documented. I tell this from my personal experience.

C ++/Tcl是一个可以轻松集成C ++和Tcl的库. 如果您同时使用两种语言编写程序,将会发现它非常有用.

C++/Tcl is a library that allows to easily integrate C++ and Tcl. If you write programs in both languages, you will find it to be extremely helpful.

C ++/Tcl库的灵感来自Boost.Python库,并旨在提供类似的接口.

The C++/Tcl library was inspired by the Boost.Python library and was designed to provide a similar interface.

当前,C ++/Tcl库提供以下功能: 支持使用C ++模块扩展Tcl以及将Tcl嵌入C ++应用程序. 可以在Tcl中将免费的C ++函数公开为命令. 可以定义类和类成员函数,可以在Tcl中以类似于SWIG包装程序的样式显示. 可以通过C ++代码操作Tcl列表和对象.

Currently, the C++/Tcl library offers the following features: Support for both extending Tcl with C++ modules and embedding Tcl in C++ applications. Possibility to expose free C++ functions as commands in Tcl. Possibility to define classes and class member functions, visible in Tcl in the style similar to SWIG wrappers. Possibility to manipulate Tcl lists and objects from the C++ code.

这篇关于如何使用C ++扩展TCL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆