Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何公开Boost::shared_ptr<;T>;到Tcl+;SWIG接口文件?_C++_Tcl_Swig - Fatal编程技术网

C++ 如何公开Boost::shared_ptr<;T>;到Tcl+;SWIG接口文件?

C++ 如何公开Boost::shared_ptr<;T>;到Tcl+;SWIG接口文件?,c++,tcl,swig,C++,Tcl,Swig,我想使用SWIG向Tcl层公开boost::shared_Ptr。但目前我不知道我能不能揭露这件事。我发现SWIG/Lib文件夹包含shared\u ptr.I的接口文件。但是在内容中我发现我不能直接使用它。它必须包含在“boost\u shared\u ptr.i”之后。但是在“SWIG/Lib/tcl”文件夹中没有类似的boost\u shared\u ptr.i,但是我们有类似的界面,我可以将其包含在Java中 您不能使用标准的共享ptr吗?我是说std::tr1::shared\u pt

我想使用SWIG向Tcl层公开
boost::shared_Ptr
。但目前我不知道我能不能揭露这件事。我发现SWIG/Lib文件夹包含
shared\u ptr.I
的接口文件。但是在内容中我发现我不能直接使用它。它必须包含在“
boost\u shared\u ptr.i
”之后。但是在“
SWIG/Lib/tcl
”文件夹中没有类似的
boost\u shared\u ptr.i
,但是我们有类似的界面,我可以将其包含在Java中

您不能使用标准的共享ptr吗?我是说std::tr1::shared\u ptr?在gcc中,您需要

#include <tr1/memory>
#包括

当我上次尝试时,所有SWIG中都没有对boost/shared\u ptr的良好支持。Python的覆盖率最高。我很想知道这是否发生了变化


就我在SWIG方面的其他经验而言,您还需要为要公开的每种类型使用%template来实例化模板。

希望我能提供帮助,但我从未以实质性的方式进行过C++/Tcl绑定,当然也没有使用SWIG进行过绑定。(我知道一些关于如何绑定基本类型的知识,但是
shared_ptr
?一点也不知道。我更多地使用普通的旧C…)您不是想将T作为参数公开给Tcl,是吗?我实际上想在Tcl中为boost::shared_ptr创建句柄。我不能使用std::tr1::shared_ptr,由于我的库将同时用于Java和TCL,而且我已经公开了Java上的所有内容,而且它似乎在那里工作得很好。更重要的是,Microsoft在C++0x兼容性方面失败了。它适用于WinXPSP2或更高版本,所以如果您制作的项目将有许多用户,您还不能使用它。