我想在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