-
Notifications
You must be signed in to change notification settings - Fork 76
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
Cannot compile #16
Comments
Thank you for your report, I will look into it |
Since 6fe704e it compile but on archlinux I had a link issue /usr/bin/ld: CMakeFiles/game.dir/Game/Renderer_SDL.cpp.o: undefined reference to symbol 'SDL_CreateTexture'
/usr/bin/ld: /usr/lib/libSDL2-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/game.dir/build.make:489: game] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:84: all] Error 2 Looks like it's because If I replace |
Does making this change break other Linux distros? |
I'm not sure, I will try some distros with lxc and let you know. It's probably due to the version of sdl, cmake or just related to archlinux. |
Simply replacing it break Ubuntu. Using a diff --git a/CMakeLists.txt b/CMakeLists.txt
index 640e718..6ecacd6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,11 @@ if(BUILD_GAME)
set_target_properties(game PROPERTIES LINKER_LANGUAGE CXX)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
- target_link_libraries(game ${SDL2_LIBRARIES} SDL2_net SDL2_mixer m dl)
+ if (TARGET SDL2::SDL2)
+ target_link_libraries(game SDL2:SDL2 SDL2_net SDL2_mixer m dl)
+ else()
+ target_link_libraries(game ${SDL2_LIBRARIES} SDL2_net SDL2_mixer m dl)
+ endif()
endif()
target_compile_definitions(game PUBLIC D2EXE) There is probably a cleaner way to do it Ubuntu use libsdl2-2.0-0:amd64 2.0.4+dfsg1-2ubuntu2
libsdl2-dev 2.0.4+dfsg1-2ubuntu2
libsdl2-mixer-2.0-0:amd64 2.0.1+dfsg1-1
libsdl2-mixer-dev:amd64 2.0.1+dfsg1-1
libsdl2-net-2.0-0:amd64 2.0.1+dfsg1-2
libsdl2-net-dev:amd64 2.0.1+dfsg1-2
cmake 3.5.1-1ubuntu3 While archlinux sdl2 2.0.9-1
sdl2_mixer 2.0.4-1
sdl2_net 1:2.0.1-2
cmake 3.13.1-1 And opensuse S | Name | Type | Version | Arch | Repository
---+---------------------------+---------+-------------------+--------+-----------
i+ | libSDL2-2_0-0 | package | 2.0.8-lp150.1.1 | x86_64 | repo-oss name: libSDL2-2_0-0
i+ | libSDL2-devel | package | 2.0.8-lp150.1.1 | x86_64 | repo-oss name: libSDL2-devel
i+ | libSDL2_mixer-2_0-0 | package | 2.0.2-lp150.1.3 | x86_64 | repo-oss name: libSDL2_mixer-2_0-0
i+ | libSDL2_mixer-devel | package | 2.0.2-lp150.1.3 | x86_64 | repo-oss name: libSDL2_mixer-devel
i+ | libSDL2_net-2_0-0 | package | 2.0.0-lp150.1.3 | x86_64 | repo-oss name: libSDL2_net-2_0-0
i+ | libSDL2_net-devel | package | 2.0.0-lp150.1.3 | x86_64 | repo-oss name: libSDL2_net-devel
i+ | cmake | package | 3.10.2-lp150.1.5 | x86_64 | repo-oss name: cmake |
Hi have installed the same and not work : /usr/bin/ld : ne peut trouver -lSDL2:SDL2 |
Have compile on fedora for fix |
I cannot compile newest version from master. system is Linux, OpenSUSE Leap 15. everything related to SDL is installed to compile it.
The text was updated successfully, but these errors were encountered: