我正在尝试安装此代码我正在尝试为一个大学项目安装这个git-repo,但我陷入了困境,因为 ld 似乎无法正确链接 lua。我按照安装说明进行操作并使用以下命令编译代码:
catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_CXX_STANDARD=14
Run Code Online (Sandbox Code Playgroud)
失败并显示几条消息,例如:
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_toboolean(lua_State*, int)'
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_tonumberx(lua_State*, int, int*)'
...
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_pushstring(lua_State*, char const*)'
/usr/bin/ld: /home/felixk/catkin_ws/devel/lib/libflatland_lib.so: undefined reference to `lua_isstring(lua_State*, int)'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
该代码已经过测试并且可以在 Ubuntu 18.04 上运行,但我正在尝试让它在 Manjaro 上运行。手册指出这liblua5.2-dev是需要的,我从 AUR安装了lua52 ,它似乎提供了正确的库。
的输出ldd是:
ldd /home/felixk/catkin_ws/devel/lib/libflatland_lib.so | grep lua
liblua5.2.so.5.2 => /usr/lib/liblua5.2.so.5.2 (0x00007f23fd51c000)
Run Code Online (Sandbox Code Playgroud)
然后我检查是否/usr/lib/liblua5.2.so.5.2存在并且确实存在。我试图用来readelf检查是否liblua5.2.so.5.2 …