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

More than one instance of overloaded function "CloseWindow" / "ShowCursor" has 'C' Linkage #2244

Closed
JakeWade5 opened this issue Dec 24, 2021 · 1 comment

Comments

@JakeWade5
Copy link

Issue:

RayLib clashing with Windows libraries, the following errors:
More Than one instance of overloaded function "CloseWIndow" has 'C' Linkage
More Than one instance of overloaded function "ShowCursor" has 'C' Linkage

'CloseWindow': you cannot overload a function with 'extern "C" linkage'
'ShowCursor': you cannot overload a function with 'extern "C" linkage'

I tried using the following workaround #1217, which did not help only caused more issues.

Anyone have a similar issue or any ideas on how to fix this problem?

Environment:
CMake, Ninja with Visual Studio
OS: Windows

I've tried adding RayLib using the following methods:

I've tried using VcPKG as a dependency manager, this gave me the error.
Adding RayLib to the CMakeFile via the following:
`# Set this to the minimal version you want to support
find_package(raylib 3.0 QUIET) # Let CMake search for a raylib-config.cmake

You could change the QUIET above to REQUIRED and remove this if() clause

This part downloads raylib and builds it if it's not installed on your system

if (NOT raylib_FOUND) # If there's none, fetch and build raylib
include(FetchContent)

FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/master.tar.gz
)

FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)

set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples

# build raylib
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})

endif()

endif()

target_link_libraries(${PROJECT_NAME} raylib)
`

@raysan5
Copy link
Owner

raysan5 commented Dec 24, 2021

This is a duplicate issue and a workaround was already provided and it works for many users. I'm afraid there is no plans to change raylib because of that

@raysan5 raysan5 closed this as completed Dec 24, 2021
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

No branches or pull requests

2 participants