當我嘗試編譯一個小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