我尝试使用SWIG在Python中包装一些C ++函数。在教程之后,我编写了一个接口文件
%module rasnetclient
%{
#include "rasnetclientcomm.hh"
%}
RasnetClientComm(std::string rasmgrHost, int rasmgrPort);
RasnetClientCommDestroy();
int connectClient(std::string userName, std::string passwordHash);
int disconnectClient();
并生成一个包装器。但是,当我尝试使用g++ -c -std=c++0x rasnetclientcomm.cc rasnetclient_wrap.c -I /usr/include/python2.7
编译它时,我收到以下错误:
rasnetclient_wrap.c: In function 'PyObject* _wrap_connectClient(PyObject*, PyObject*)':
rasnetclient_wrap.c:3383:40: error: 'connectClient' was not declared in this scope
rasnetclient_wrap.c: In function 'PyObject* _wrap_disconnectClient(PyObject*, PyObject*)':
rasnetclient_wrap.c:3396:34: error: 'disconnectClient' was not declared in this scope
我是否对接口文件的定义做错了?任何帮助将不胜感激。