Skip to content

CGLM_USE_ANONYMOUS_STRUCT: expected an expression #475

@EranStockdale

Description

@EranStockdale

Hello there!

I'm trying to use cglm. It was working fine until I set my C++ standard (yes yes I know cglm is for C) to C++20, I'm getting errors such as this:

src/client/main.cpp:191:101: error: 'vec3s' {aka 'union vec3s'} has no member named 'x'
  191 |                         ImGui::Text("Camera Movement Direction %f, %f, %f", cameraMovementDirection.x, cameraMovementDirection.y, cameraMovementDirection.z);

Now, I dug into cglm/struct.h and found

#if CGLM_USE_ANONYMOUS_STRUCT

blocking the property definitions. Okay, that's fine, add -DCGLM_USE_ANONYMOUS_STRUCT to the compiler flags. Nope. Here:
Image

Anyhow, how can I fix this? I have a feeling the ifs should be ifdefs. I'm happy to submit a PR if this is the case.

Thanks,
Eran

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions