当我尝试编译一个小Lua程序中,我得到这些错误:的Lua编译链接错误
/usr/lib//liblua52.so: undefined reference to `dlsym'
/usr/lib//liblua52.so: undefined reference to `dlerror'
/usr/lib//liblua52.so: undefined reference to `dlopen'
/usr/lib//liblua52.so: undefined reference to `dlclose'
当然,我-ldl链接。我在我的Ubuntu上安装了lua5.2-dev。 如果您需要更多信息,请咨询我。
谢谢!
什么是确切的编译器/链接器命令行,给你这个错误? – che 2012-07-12 07:55:23
g ++ -o client Box.o ConnexionException.o GameData.o LuaManager.o main.o Parser.o ParsingException.o Player.o Socket.o -L/usr/lib/-ldl -Llib/lib/-Wl, - -rpath = lib/lib -llua52 -Wl, - rpath = lib/lib -lSLB /usr/lib//liblua52.so:未定义的对'dlsym'的引用 /usr/lib//liblua52.so:undefined reference to'dlerror' /usr/lib//liblua52.so:未定义的引用'dlopen' /usr/lib//liblua52.so:未定义的引用'dlclose' – 2012-07-12 07:58:00
将'-ldl'放在链接的末尾命令行。 – lhf 2012-07-12 11:42:14