3
我正在研究一個非常舊的源代碼(在Red Hat中編譯)。在它有lua-4.0.1之前,我只編譯了最新的lua(lua-5.1.4),並將它安裝在與舊版本相同的目錄中。這個實現並不是很大,除了幾個函數名稱之外,沒有太多的改變,我不得不包含「lauxlib.h」來編譯它。它編譯沒有任何問題,但它給出了這些鏈接錯誤。從lua 4.0.1升級到5.1.4時出現鏈接錯誤
/usr/local/lib/liblua.a(loadlib.o): In function `ll_load':
loadlib.o(.text+0x19): undefined reference to `dlopen'
loadlib.o(.text+0x2a): undefined reference to `dlerror'
/usr/local/lib/liblua.a(loadlib.o): In function `ll_sym':
loadlib.o(.text+0x52): undefined reference to `dlsym'
loadlib.o(.text+0x63): undefined reference to `dlerror'
/usr/local/lib/liblua.a(loadlib.o): In function `ll_unloadlib':
loadlib.o(.text+0x8): undefined reference to `dlclose'
基本上所有的路徑是正確的,但我用的是相同的標誌編譯器與舊,我還沒有改變makefile文件在所有。
-static -lpthread -lnsl -lutil -ldl -lmysqlclient -llua -llualib -lz -lcppunit
ldl標誌已經存在。
我只想知道要嘗試的東西。一切都被讚賞。這讓我瘋狂。