Comments (7)
Thank you for your report, I will look into it
from opend2.
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 SDL2_LIBRARIES
is empty (see archlinux issue #57972 and there)
If I replace SDL2_LIBRARIES
with SDL2::SDL2
it link and works, I have sound and can go to the select hero class (I guest for now it's the only thing you can do without a TCP/IP on 1.10). (using c220ddf)
from opend2.
Does making this change break other Linux distros?
from opend2.
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.
from opend2.
Simply replacing it break Ubuntu.
Using a TARGET
check like they did here "cannot find sdl2" works for ubuntu, archlinux and opensuse.
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
from opend2.
Hi have installed the same and not work :
/usr/bin/ld : ne peut trouver -lSDL2:SDL2
collect2: erreur: ld a retourné le statut de sortie 1
make[2]: *** [CMakeFiles/game.dir/build.make:489: game] Error 1
make[1]: *** [CMakeFiles/Makefile2:79: CMakeFiles/game.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
CMakeLists.txt
from opend2.
Have compile on fedora for fix
But is not possible to create player
from opend2.
Related Issues (20)
- Status on logic calculations HOT 7
- Segmentation fault (core dumped) HOT 1
- After select character, i got error HOT 7
- After compile with Linux? HOT 4
- Unable to compile on Linux HOT 2
- Requirements for Development HOT 1
- Run on Elbrus HOT 6
- Library issues in Linux (possibly Windows) HOT 3
- Feature Request: Support GoG's Battle.net server?
- D2Menu Character Create Screen Offsets DynamicPanel off the screen
- MainMenu Changes and Lots of menu item disappear
- [Feature Request] Use ESC button to leave scenes.
- Character Input Box disappear HOT 1
- By not providing FindSDL2.cmake
- Open thread - discussion about project direction HOT 4
- Q:what is the current status of this project HOT 1
- a note on Russian charset
- building on linux HOT 8
- windows.h missing while building for linux..
- You can not include Windows.h if you want the project to build on Linux
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opend2.