Skip to content

(StructName) {...} gives error C4576 with MSVC #76

Closed

Description

@Marriaud

Example on line :

DrawPlane((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector2){ 32.0f, 32.0f }, LIGHTGRAY); // Draw ground

If I remove the brackets around Vector3, it works. (it also works without casting)

The issue has been encountered by a realib user. See pull request raysan5/raygui#44
and issue raysan5/raygui#33

Activity

  1. added a commit that references this issue on Nov 6, 2020
    4c0c273
  2. megapro17 commented on Nov 24, 2021

    @megapro17

    It's still not fixed

  3. thomaswtn01 commented on Jun 27, 2022

    @thomaswtn01

    do u have solution for that ?

  4. RobLoach commented on Jun 27, 2022

    @RobLoach
    Owner

    Is this still an issue?

  5. megapro17 commented on Jun 28, 2022

    @megapro17

    Not an issue, not coding in C++ anymore

  6. TokyoSU commented on Jul 3, 2022

    @TokyoSU
    Contributor

    @megapro17 you need to use CLITERAL define since (Vector3){ 0.0f, 0.0f, 0.0f } is for C not C++, if you want to code in c++ you need to remove the ( and ) like this: Vector3{ 0.0f, 0.0f, 0.0f } or with the define CLITERAL(Vector3){ 0.0f, 0.0f, 0.0f } it will convert from c or c++ automatically :) PS: CLITERAL is from raylib.h

  7. penggrin12 commented on Jul 16, 2026

    @penggrin12
    Collaborator

    i believe this was fixed in #393 ..?

  8. RobLoach commented on Jul 16, 2026

    @RobLoach
    Owner

    Thanks! We could open up a new issue if it's not fixed fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions