From abf4105d64f8787f1318b590ce1d691535c0c1f7 Mon Sep 17 00:00:00 2001 From: dervish Date: Tue, 16 Jul 2019 19:19:52 -0500 Subject: [PATCH] Issue 19 - Fix library dependencies for D2 client and server The two libraries libD2Client.so and libD2Server.so depend on the common shared library file, after linking them with it you no longer get undefined symbols. --- CMakeLists.txt | 2 ++ Game/Platform_Linux.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 640e718..8d1fc69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,7 @@ if(BUILD_D2CLIENT) set_target_properties(D2Client PROPERTIES OUTPUT_NAME D2Client) set_target_properties(D2Client PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(D2Client D2Common) target_link_libraries(D2Client ${STATIC_LIBRARIES}) target_compile_definitions(D2Client PUBLIC D2CLIENT) endif() @@ -127,6 +128,7 @@ if(BUILD_D2SERVER) set_target_properties(D2Server PROPERTIES OUTPUT_NAME D2Server) set_target_properties(D2Server PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(D2Server D2Common) target_link_libraries(D2Server ${STATIC_LIBRARIES}) target_compile_definitions(D2Server PUBLIC D2SERVER) endif() diff --git a/Game/Platform_Linux.cpp b/Game/Platform_Linux.cpp index 7df6dd1..758b30f 100644 --- a/Game/Platform_Linux.cpp +++ b/Game/Platform_Linux.cpp @@ -218,7 +218,7 @@ namespace Sys } else if (nModule == MODULE_SERVER) { - bModuleFound = FS::Find("liD2Game.so", szModulePath, MAX_D2PATH_ABSOLUTE); + bModuleFound = FS::Find("libD2Server.so", szModulePath, MAX_D2PATH_ABSOLUTE); } Log_ErrorAssertReturn(bModuleFound, nullptr);