-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fails to compile #1
Comments
And yes, I am using Ubuntu 22.04 LTS (if that's necessary) |
if you cannot compile src/main.c using gcc then try to simply use g++ due main.c is actually contain c++ specific code |
I changed the Threads dependency checking in FindSDL2.cmake to this code and it compiles, though I don't know if this causes bugs in other systems: if(NOT APPLE)
set(CMAKE_THREAD_PREFER_PTHREAD ON)
find_package(Threads QUIET)
if(CMAKE_USE_PTHREADS_INIT)
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-pthread")
elseif(NOT CMAKE_THREAD_LIBS_INIT)
set(SDL2_THREADS_NOT_FOUND "Could NOT find Threads (Threads is required by SDL2).")
if(SDL2_FIND_REQUIRED)
message(FATAL_ERROR ${SDL2_THREADS_NOT_FOUND})
else()
if(NOT SDL2_FIND_QUIETLY)
message(STATUS ${SDL2_THREADS_NOT_FOUND})
endif()
return()
endif()
unset(SDL2_THREADS_NOT_FOUND)
endif()
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am beginner and I tried to compile it using the
cmake ..
and I get a pthread error.And the CMakeOutput.log is,
I have downloaded the required dependencies.
The text was updated successfully, but these errors were encountered: