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

[raymath.h] use CLITERAL for MSVC #4127

Closed
wants to merge 1 commit into from

Conversation

brccabral
Copy link
Contributor

I had same error as #1525 , error C4576. I applied the same solution which is to use CLITERAL. Example rlgl_standalone.c does not import raylib.h, so I had to add double check for CLITERAL definition.

@raysan5
Copy link
Owner

raysan5 commented Jul 1, 2024

@brccabral thanks but I prefer to not add additional macros just for that use case, in all raymath I already avoided compound-literals usage.

@raysan5 raysan5 closed this Jul 1, 2024
@brccabral
Copy link
Contributor Author

fyi, just in case someone else has the same problem.

The error was
C:\Program Files\raylib\include\raymath.h(2580,34): error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion

I was getting it because I was targeting the Raylib installation path directly

target_include_directories(${PROJECT_NAME} PRIVATE ${RAYLIB_PATH}/include)
target_link_directories(${PROJECT_NAME} PRIVATE ${RAYLIB_PATH}/lib)

Removing those lines and using find_package solves the error without any modification to raymath.h.

find_package(raylib REQUIRED)

On Windows, make sure C:\path\to\raylib is in your %PATH%

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 this pull request may close these issues.

None yet

2 participants