SWIG:错误:无法找到'stdexcept'

时间:2017-11-02 11:10:16

标签: swig

我使用SWIG创建一些C#包装器,但似乎我得到了一组错误,即使包含相应的.i库之后!

%module test_module

%include <stl.i>
%include <windows.i>
%include <typemaps.i>
%include <stdint.i>
%include <std_string.i>
%include <std_vector.i>
%include <inttypes.i>
%include <attribute.i>
%include <cpointer.i>
%include <exception.i>
%include <carrays.i>
%include <cdata.i>
%include <cmalloc.i>
%include <constraints.i>
%include <cpointer.i>
%include <cwstring.i>
%include <intrusive_ptr.i>
%include <math.i>
%include <pointer.i>
%include <std_except.i>
%include <swigarch.i>
%include <swigrun.i>
%include <wchar.i>
%include <shared_ptr.i>

%{
  #include "Context.hpp"
%}

%feature("nspace") Context;

%include "Context.hpp"

以下是错误列表:

core\Expected.hpp(18) : Error: Unable to find 'memory'
core\Expected.hpp(19) : Error: Unable to find 'utility'
core\Expected.hpp(20) : Error: Unable to find 'typeinfo'
core\Expected.hpp(21) : Error: Unable to find 'exception'
core\Expected.hpp(22) : Error: Unable to find 'stdexcept'
core\Expected.hpp(23) : Error: Unable to find 'type_traits'
core\Definitions.hpp(22) : Error: Unable to find 'inttypes.h'
core\Definitions.hpp(23) : Error: Unable to find 'type_traits'
core\Definitions.hpp(24) : Error: Unable to find 'stddef.h'
core\Definitions.hpp(25) : Error: Unable to find 'stdint.h'
core\EnumBitMaskGenerator.hpp(18) : Error: Unable to find 'type_traits'
core\PImpl.hpp(20) : Error: Unable to find 'type_traits'
core\PImpl.hpp(21) : Error: Unable to find 'memory'
core\PImplSizes.hpp(18) : Error: Unable to find 'vector'
core\PImplSizes.hpp(19) : Error: Unable to find 'deque'
core\PImplSizes.hpp(20) : Error: Unable to find 'fstream'
core\PImplSizes.hpp(21) : Error: Unable to find 'memory'
core\PImplSizes.hpp(22) : Error: Unable to find 'map'
core\PImplSizes.hpp(23) : Error: Unable to find 'mutex'
core\PImplSizes.hpp(24) : Error: Unable to find 'atomic'
concurrency\ThreadLocalPointer.hpp(20) : Error: Unable to find 'thread'
concurrency\ThreadLocalPointer.hpp(21) : Error: Unable to find 'unordered_map'

这里是命令行,带有选项:

swig.exe -includeall -c ++ -csharp -macroerrors -cppext cpp ...

有什么想法吗?

由于

2 个答案:

答案 0 :(得分:0)

尝试使用-I设置包含路径。看到: http://swig.org/Doc3.0/SWIG.html#SWIG_nn2

答案 1 :(得分:0)

似乎来自SWIG / Lib的* .i文件非常无用,并且作为一种存根提供。你必须添加SWIG / Lib / csharp作为SWIG包括dir。