gpt4 book ai didi

python - Swig 错误 - 错误 : Syntax error in input(2)

转载 作者:行者123 更新时间:2023-11-30 03:39:21 25 4
gpt4 key购买 nike

我一直在尝试为 C++ 库创建一个 Python 包装器。 Swig 给出了这部分代码的错误,我不明白是什么导致了错误。我也是使用 swig 的新手。它给我的错误是“输入(2)中的语法错误”,这也是代码部分。

typedef void (__cdecl *TSI_FUNCTION_CAMERA_CONTROL_CALLBACK) (int ctl_event, void*context);
typedef void (__cdecl *TSI_FUNCTION_CAMERA_CONTROL_CALLBACK_EX) (int ctl_event, TSI_FUNCTION_CAMERA_CONTROL_INFO *ctl_event_info, void *context);
typedef void (__cdecl *TSI_FUNCTION_IMAGE_NOTIFICATION_CALLBACK) (int notification, void *context);
typedef void (__cdecl *TSI_FUNCTION_IMAGE_CALLBACK) (TsiImage *tsi_image, void *context);
typedef void (__cdecl *TSI_TEXT_CALLBACK_FUNCTION) (char *str, void *context);

最佳答案

SWIG 不理解 __cdecl。您可能需要将 `%include "windows.i"添加到您的界面文件中。您可能还有其他 undefined symbol ,但根据您提供的信息我无法判断。

%module example
%{
#include "example_if.h"
%}
...
# Here it must be present
%include "windows.i"
...
%include "example_if.h"

关于python - Swig 错误 - 错误 : Syntax error in input(2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38909890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com