2012-04-19 184 views
0

我試圖按照http://home.wlu.edu/~levys/software/ardrone_autopylot/中的教程將MATLAB與ardrone接口。完成「make」後,我遇到的問題是使用gcc編譯器,但我不確定這一點。這樣做之後GCC編譯器問題

輸出:

 
In file included from /usr/local/MATLAB/R2011b/extern/include/matrix.h:293, 
       from /usr/local/MATLAB/R2011b/extern/include/engine.h:44, 
       from matlab_agent.c:29: 
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h:149: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’ 
In file included from /usr/local/MATLAB/R2011b/extern/include/matrix.h:294, 
       from /usr/local/MATLAB/R2011b/extern/include/engine.h:44, 
       from matlab_agent.c:29: 
/usr/local/MATLAB/R2011b/extern/include/tmwtypes.h:798: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mwSignedIndex’ 
matlab_agent.c: In function ‘agent_comm_act’: 
matlab_agent.c:90: warning: initialization from incompatible pointer type 
make: [matlab_agent.o] Error 1 

上述這些線看起來像一個GCC編譯器錯誤,誰碰到過這樣的問題,請分享你的經驗。

回答

1

如果沒有您的源代碼,無法確切知道發生了什麼;我注意到,149行中的typedef是包含文件中第一個真正的C代碼,這使得我認爲在包含它之前在某個地方有無意的垃圾。見,例如,如何處理下面的代碼段發生:

int 
#include <stddef.h> 

(這不會產生完全相同的錯誤,至少在我的系統,我不知道是什麼令牌(S)會這麼做。)