我有下面的SWIG接口文件結構,我覺得是無效的。 int func(usigned char key [20])駐留在headerThree.h中。當我離開包含「HeaderThree.h」時,我得到一個重複的int func(SWIGTYPE_p_unsigned_char key);.如果我刪除%include「HeaderThree.h」,則其他函數不會顯示在生成的Example.java文件中。只有int func(short []鍵)纔會顯示。我想將SWIG .i文件配置爲不具有 函數(SWIGTYPE_p_unsigned_char鍵)函數,但是要包含在HeaderThree.h中的其餘函數。有任何想法嗎?SWIG接口文件結構導致重複的Java函數
%module Example
%{
#include "HeaderOne.h" //has constants and type definitions
#include "HeaderTwo.h" // has an #include "HeaderOne.h" and its own C apis
#include "HeaderThree.h" // has an #include "HeaderOne.h" and its own C apis
%}
%include "arrays_java.i"
int func(unsigned char key[20]);
%include "HeaderOne.h" //has constants and type definitions
%include "HeaderTwo.h" // has an #include "HeaderOne.h" and its own C apis
%include "HeaderThree.h" // has an #include "HeaderOne.h" and its own C apis
我使用了選項#2,因爲我們不想更改頭文件。感謝所有的選擇和明確的解釋! – c12