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

fatal error: 'lua.hpp' file not found #1207

Open mikeabrantes opened 1 year ago

mikeabrantes commented 1 year ago
/otclient/src/framework/luaengine/luainterface.cpp:27:10: fatal error: 'lua.hpp' file not found
#include <lua.hpp>
         ^~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/otclient.dir/src/framework/luaengine/luainterface.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/otclient.dir/all] Error 2
make: *** [all] Error 2

This happen when executing the: "make -j$(sysctl -n hw.ncpu)"

macOS Monterey (12.4)

sornii commented 1 month ago

I stumbled upon this problem as well. It seems lua was not installed. The docs suggest using brew but the lua formulae is disabled.

❯ brew install lua@5.1 Error: lua@5.1 has been disabled because it is deprecated upstream!

We'd need to use a tap or install lua@5.1 by ourselves.

diath commented 1 month ago

You can brew install luajit instead and configure the project with -DLUAJIT=ON flag when running CMake.

sornii commented 1 month ago

With @diath help and after brew install mesa now I'm stuck at

[100%] Linking CXX executable otclient ld: warning: Linking with PIE, -image_base will be ignored ld: warning: ignoring duplicate libraries: '-lSystem' ld: warning: search path '/usr/X11R6/lib' not found ld: library 'GL' not found clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [otclient] Error 1 make[1]: [CMakeFiles/otclient.dir/all] Error 2 make: *** [all] Error 2

I'm using this to run the build

#!/bin/bash

PREFIX=$(brew --prefix)

cmake \
  -DUSE_STATIC_LIBS=OFF \
  -DLUAJIT=ON \
  -DBoost_INCLUDE_DIR=$PREFIX/Cellar/boost@1.76/1.76.0_5/include/ \
  -DOPENSSL_INCLUDE_DIR=$PREFIX/Cellar/openssl@3/3.3.0/include/ \
  -DGMP_INCLUDE_DIR=$PREFIX/Cellar/gmp/6.3.0/include \
  -DGMP_LIBRARY=$PREFIX/Cellar/gmp/6.3.0/lib/libgmp.dylib \
  ../

make -j$((  $(sysctl -n hw.ncpu) - 1   ))

I'm using Sonoma btw.

diath commented 1 month ago

otclient doesn't support MacOS natively, you need XQuartz (X11 server for MacOS) installed (brew install xquartz). I'm not sure about GL though, I don't use a Mac.