2016-12-29 21 views
0

我收到試圖創建一個函數,結構aiMatrix4x4 *或任何其他aiStructs當上面的錯誤,我不知道爲什麼,我可以在我的模型正確,我不能讓一個函數上述結構的一些奇怪的原因參數,這裏是我的問題的代碼,我甚至可以隔離它,它仍然給我的錯誤...Assimp闡述類型指的typedef

#include <math.h> 
#include <assimp/cimport.h> 
#include <assimp/scene.h> 
#include <assimp/postprocess.h> 
#include <assimp/matrix4x4.h> 

// A Bit Later in the Code 

static inline void mat4x4_loadassimp(mat4x4 M, struct aiMatrix4x4* a); 

我使用的是最新的assimp從源代碼編譯..與C.使用clang作爲編譯器。

+0

我不能幫你更該項目的開發https://github.com/assimp/assimp/issues/ 1126。但是我沒有'struct aiMatrix4x4 * a'的問題,我只得到'unknow mat4x4'。 – Stargateur

+0

看起來'typedef'只能用於C++。 – Stargateur

+0

你應該發佈你的真實代碼,因爲我不能用這個[mcve]重現。 – Stargateur

回答

0

按照docaiMatrix4x4是C++中的一個typedef。

所以你不能用C++ struct aiMatrix4x4

static inline void mat4x4_loadassimp(mat4x4 M, aiMatrix4x4 *a); 

如果你用C編譯,你必須寫:

static inline void mat4x4_loadassimp(mat4x4 M, struct aiMatrix4x4 *a); 
+0

'inline'改變了代碼的語義wrt一個定義規則。你可能在談論是否內聯函數的決定。 –

+0

@ M.M你能聯繫我一些文檔嗎?我不知道你在做什麼。 – Stargateur

+1

看[這裏](http://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99)和[這裏](http://stackoverflow.com/questions/216510/extern-inline) –