我有一个相当广泛的C++项目,我正在使用。为了好玩,我想我应该尝试一下非常简单的swig示例,它只使用项目的头文件来构建一个python模块。
Swig运行正常并创建了一个project_wrap.cxx文件。但是,当我尝试编译该文件并将其与项目的其余部分链接时,我遇到了错误:
它们似乎主要与MS COLeDateTime有关:
Error 14 error C2061: syntax error : identifier 'COleDateTime' 由声明产生,例如:
void SetStartTime (COleDateTime dt ) {m_simstart_time = dt; }或者来自IntelliSense:
194 IntelliSense: identifier "COleDateTime" is undefined我假设解决方法是使用windows.i文件,但有谁有一些技巧/经验/示例吗?
发布于 2012-11-28 16:42:10
添加
%{
#include "the_coledatetime_header.h" // whatever the header is
%}发送到您的.i
# project_wrap.cxx将被添加到您的include中,并且应该进行编译。有关更多信息,请查看http://www.swig.org/Doc2.0/SWIGDocumentation.html#Preprocessor_delimiters。
https://stackoverflow.com/questions/13581600
复制相似问题