我想在PHP中使用我的C++类。在我的C++代码,我宣布的typedef为:SWIG typedef recognition
typedef unsigned char byte;
,所以我打算让痛饮考虑我的包装类的typedef,我的接口文件是这样的:
%module xxx
typedef unsigned char byte;
%include "xxx.h"
....
%{
typedef unsigned char byte;
#include "xxx.h"
%}
,并在我的测试代码我指的类型:
byte *data;
,但我得到了以下错误:
Fatal error: Class 'unsigned_char' not found in xxx.php
P.S:我还在我的界面文件中包含“stdint.i”,但得到了相同的错误
任何想法?
非常感谢您Flexo;) – A23149577