【问题标题】:Assimp elaborated type refers to typedefAssimp 细化类型指 typedef
【发布时间】:2017-05-13 08:40:16
【问题描述】:

我在尝试创建一个采用 struct aiMatrix4x4* 或任何其他 aiStructs 的函数时收到上述错误,我不知道为什么,我可以正确地创建模型,我只是无法使用上述结构作为参数创建函数出于某种奇怪的原因,这是我质疑的代码,我什至可以隔离它,但它仍然给我错误...

#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 作为编译器。

【问题讨论】:

  • 除了项目开发人员github.com/assimp/assimp/issues/1126 之外,我无法为您提供更多帮助。但我对struct aiMatrix4x4 *a没有问题,我只得到unknow mat4x4
  • 看来typedef 仅适用于C++。
  • 你应该发布你的真实代码,因为我无法用这个minimal reproducible example复制。
  • 您包含与您的 mcve 不同的“linmath.h”。我们无法解决这个问题,因为您没有完全相同的代码。

标签: c matrix assimp


【解决方案1】:

根据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);

【讨论】:

  • inline 改变了代码 w.r.t 的语义。唯一定义规则。您可能正在谈论是否内联函数的决定。
  • @M.M 你能给我链接一些文档吗?我不知道你在做什么。
  • herehere
  • 实际上,当我删除结构设置时,它告诉我必须使用结构标识符
猜你喜欢
  • 1970-01-01
  • 2014-08-25
  • 2013-09-09
  • 1970-01-01
  • 1970-01-01
  • 2022-01-22
  • 1970-01-01
  • 1970-01-01
  • 2021-02-02
相关资源
最近更新 更多