edubart / otclient

An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
640 stars 402 forks source link

I'm getting an error at the end of the compilation #1178

Open curruwilla opened 2 years ago

curruwilla commented 2 years ago

I'm getting an error at the end of the compilation, look this:

image

How can I fix and compile without errors?

I followed the step by step: image

I'm using UBUNTU 20.04 LTS - 64bits

kleberholtz commented 2 years ago

UP! I'm also having the same problem, how to fix it? Note: I'm using Ubuntu 20.04 LTS - 64bits

diath commented 2 years ago

Can you try applying the following change to the src/framework/CMakeLists.txt file and see if that helps?

diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt
index cb74320d..3fea96cc 100644
--- a/src/framework/CMakeLists.txt
+++ b/src/framework/CMakeLists.txt
@@ -285,7 +285,7 @@ else()
         set(SYSTEM_LIBRARIES "")
     else()
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
-        set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic -Wl,-rpath,./libs") # rdynamic is needed by backtrace.h used in crash handler
+        set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -lm -rdynamic -Wl,-rpath,./libs") # rdynamic is needed by backtrace.h used in crash handler
         set(SYSTEM_LIBRARIES dl rt)
     endif()
 endif()

Alternatively you can also try disabling the sound framework if you don't need it via -DFRAMEWORK_SOUND=OFF CMake argument.

kleberholtz commented 2 years ago

The change in CMakeLists.txt didn't work, however with the option -DFRAMEWORK_SOUND=OFF it worked just fine! thankful.

wioxjk commented 1 year ago

There workaround to the issue is here: https://otland.net/threads/otclient-problems-compiling-on-ubuntu-20.270236/