我正在尝试从也使用http://www.yonch.com/wireless库的无线通信库( IT++ )编译一些SWIG绑定。我在Ubuntu14.04上使用了SWIG版本2.0.11。
这是我在试图构建时遇到的错误:
/usr/include/itpp/base/binary.h:162: Error: Syntax error in input(1)
以下是binary.h中的第162行:
ITPP_EXPORT std::ostream &operator<<(std::ostream &output, const bin &inbin);
如果需要该文件的其余部分,可以在这里找到:source.html
这是正在使用的SWIG命令行调用:
/usr/bin/swig -c++ -python -I/home/user/anaconda/include/python2.7 -I../../../include -I/usr/include -I../../../bindings/itpp -I../../../bindings/itpp/.. -DHAVE_CONFIG_H -o base_sparse.cpp ../../../bindings/itpp/base_sparse.i
我几乎没有使用SWIG的经验,似乎看不到代码会导致语法错误的原因。任何见解都将不胜感激!
发布于 2015-07-22 17:10:56
出口是不懂的
我通常添加一个
#define ITPP_EXPORT在您的.i文件中,在包含了C/C++头之后,然后使用
%include "Someheader.h"https://stackoverflow.com/questions/31569607
复制相似问题