0

I am receiving the above error when trying to create a function that takes struct aiMatrix4x4* or any other aiStructs, I don't know why, I can my models properly, I just cannot make a function with the above struct as parameters for some odd reason, here's the code i question, I can even isolate it and it still gives me the error...

#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);

I am using the latest assimp compiled from source... with C. Using clang as the compiler.

Whiteclaws
  • 902
  • 10
  • 31
  • I can't help you more that the dev of the project https://github.com/assimp/assimp/issues/1126. But I have not problem with `struct aiMatrix4x4 *a`, I only get `unknow mat4x4`. – Stargateur Dec 29 '16 at 16:44
  • Seem that the `typedef` is only available with C++. – Stargateur Dec 29 '16 at 17:15
  • You should post your real code because I can't reproduce with this [mcve]. – Stargateur Dec 29 '16 at 17:41
  • http://imgur.com/a/kaArY – Whiteclaws Dec 29 '16 at 19:13
  • you include "linmath.h" that differs from you mcve. We can't solve this problem is you don't have the exact same code. – Stargateur Dec 29 '16 at 19:35
  • @Stargateur, linmath I promise has nothing to do with the assimp matrix, i had the issue even before I included linmath.h, albeit at this point, I opened an issue on the assimp library github page so I think I'll close this thread as at this point, I'll let the developper handle it, thank you anyways – Whiteclaws Dec 29 '16 at 19:41

1 Answers1

1

According to the doc. aiMatrix4x4 is a typedef in C++.

So you can't write struct aiMatrix4x4 in C++.

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

If you compile in C, you must write:

static inline void mat4x4_loadassimp(mat4x4 M, struct aiMatrix4x4 *a);
Stargateur
  • 24,473
  • 8
  • 65
  • 91
  • `inline` changes the semantics of the code w.r.t. the one definition rule. You're probably talking about the decision whether or not to inline the function. – M.M Dec 29 '16 at 03:29
  • @M.M Can you link me some doc? I don't know what you are taking about. – Stargateur Dec 29 '16 at 03:34
  • 1
    see [here](http://stackoverflow.com/questions/6312597/is-inline-without-static-or-extern-ever-useful-in-c99) and [here](http://stackoverflow.com/questions/216510/extern-inline) – M.M Dec 29 '16 at 03:37
  • Actually, when i remove the struct setting, it tells me that I must use the struct identifier – Whiteclaws Dec 29 '16 at 15:49