我遇到了一些SWIG和wchat_t类型的问题,为了重现这个问题,我得到了一点MCVE here
问题是调用了SWIG_AsVal_wchar_t,但它没有在任何地方定义。
我已尝试按照接受的答案here但由于某种原因对我不起作用
我怎么解决这个问题?
PS:我也在github
上发布了这个问题答案 0 :(得分:1)
为了使用wchar_t,您可以包含接口cwstring.i
而不是wchar.i
。
这允许使用此修改后的libsystem.i
:
%module libsystem
%include "cwstring.i"
%{
#include "foo.h"
%}
%include "foo.h"
另一种方法是使用以下libsystem.i
包含缺失的片段:
%module libsystem
%include "wchar.i"
%include <typemaps/wstring.swg>
%{
#include "foo.h"
%}
%include "foo.h"