Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Marriaud opened this issue Nov 6, 2020 · 5 comments · Fixed by #77
Open

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

Marriaud opened this issue Nov 6, 2020 · 5 comments · Fixed by #77

Comments

@Marriaud
Copy link

Marriaud commented Nov 6, 2020

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

@megapro17
Copy link

It's still not fixed

@thomaswtn01
Copy link

do u have solution for that ?

@RobLoach RobLoach reopened this Jun 27, 2022
@RobLoach
Copy link
Owner

Is this still an issue?

@megapro17
Copy link

Not an issue, not coding in C++ anymore

@TokyoSU
Copy link
Contributor

TokyoSU commented Jul 3, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants