为重写std::exception的库生成swig接口时出错
Error generating swig interface for library which overrides std::exception
我正试图为一个库生成一个swig接口,该库具有从std::exception
继承的类。我似乎无法让它发挥作用。
这里有一个简单的例子。mylib.h
:的代码
#pragma once
#include <exception>
class CustomException : public std::exception
{
};
这是mylib.i
:的代码
%module mylib
%{
#include "mylib.h"
%}
/*
Run without anything:
mylib.h:5: Warning 401: Nothing known about base class 'std::exception'. Ignored.
*/
/*
Run with: %include <exception>
mylib.i:11: Error: Unable to find 'exception'
*/
/*
Run with: %include exception.i
mylib.h:5: Warning 401: Nothing known about base class 'std::exception'. Ignored.
*/
%include "mylib.h"
正如你在mylib.i
的评论中看到的,swig似乎很难弄清楚std::exception
是什么
使用%include <std_except.i>
:
%module test
%include <std_except.i>
%inline %{
class CustomException : public std::exception
{
};
%}
相关文章:
- 为重写std::exception的库生成swig接口时出错
- 分解SWIG Python接口 - 容器会产生命名空间冲突
- 如何制作一个满足SWIG中接口的python类
- 如何使用 SWIG 接口访问 python 中的 C++ typedef'd 结构
- 如何在SWIG接口文件中检查Lua版本
- 如何编写swig接口文件
- 通过SWIG禁用python-c 接口的隐式类型检查代码
- swig:接口简单的C 类,返回向量
- 如何使用SWIG中的相同接口生成两个代理类
- 如何为使用矢量的函数编写 SWIG 接口文件<string>?
- C++ 以指针作为参数的函数,并使用 swig 接口处理它
- 通过数据序列化的SWIG接口
- 使用SWIG将C++代码与perl接口
- swig接口文件的正确sstream include路径是什么
- 使用SWIG为perl创建C++接口
- 使用SWIG实现c++和Python的接口
- 如何将 Boost::shared_ptr 暴露到<T> Tcl + SWIG 接口文件?
- 向SWIG python接口返回字符串的最佳方法是什么?
- 是否可以禁止在 "truly lazy" SWIG 接口文件中包含类/函数?
- 在swig接口中解引用boost::shared_ptr的好方法