我在SWIG是一个新手,所以我绝对没有经验,但我真的想使用Riftek激光器的SDK(https://riftek.com/media/rit/SDK/RFDevice_SDK.zip)。你知道吗
SDK本身包含一些头文件、dll和def文件。到目前为止,我已经编写了以下SWIG文件:
/* rfdevice.i */
%module rfdevice
%{
#include <windows.i>
#include <typemaps.i>
#include "include/RF625Device.h"
#include "include/RF625Device_Legacy.h"
#include "include/RFDevice.h"
#include "include/RFEthernetDetector.h"
#include "include/RFEthernetDevice.h"
#include "include/RFQDPMotorDevice.h"
#include "include/RFSerialDevice.h"
#include "include/RFString.h"
#include "include/RFTypeDefs.h"
#include "include/serial.h"
%}
%include <windows.i>
%include <typemaps.i>
%apply void *INPUT {void *lpResultBuffer};
%apply float *OUTPUT {float *lpPointsBuffer};
%apply USHORT *OUTPUT {USHORT *lpCount};
%include "include/RFString.h"
%include "include/serial.h"
namespace RFDevice {
%include "include/RFTypeDefs.h"
%include "include/RFEthernetDetector.h"
%include "include/RFDevice.h"
%include "include/RFEthernetDevice.h"
%include "include/RFQDPMotorDevice.h"
%include "include/RFSerialDevice.h"
%include "include/RF625Device_Legacy.h"
%include "include/RF625Device.h"
}
我可以生成rfdevice\u wrap.c文件,但我无法编译它,因为我从编译器获得了大量未定义的引用。你知道吗
我的问题是: -我是否必须在I文件中包含dll或def文件? -有没有一种更快/更简单的方法让SDK使用Python?你知道吗
我正在使用g++在windows7 64位下用MinGW编译。你知道吗
到目前为止,我设法找出了我真正的问题。我根据现状修改了这个问题。你知道吗
其中一个头中有以下函数定义:
USHORT ConvertResultToPoints(void IN *lpResultBuffer, float OUT *lpPointsBuffer, USHORT OUT *lpCount, USHORT *lpMeasureCnt = NULL, USHORT *lpPacketCnt = NULL, BOOL bChecksumCheck = FALSE);
这里的“进”和“出”引起了一些问题。我不断收到以下编译器错误:
include\RF625Device_Legacy.h(259): Error: Syntax error in input(3).
在SWIG文档中的参数处理下,有可能解决这个问题。我已经把它包含在I文件中了,但是我一直得到编译器错误。你知道吗
你可以这样开始。我用CMake
这是我的CMakeLists.txt文件文件。到目前为止,我可以创建RFString对象
这是.o文件
我不得不安装一个旧版本的glibc++来让它工作。或者,您可以链接到glibc++的旧版本。你知道吗
相关问题 更多 >
编程相关推荐