linux g++ undefined reference to `dlopen'類問題

main.cpp:(.text+0x19): undefined reference to `dlopen'
main.cpp:(.text+0x22): undefined reference to `dlerror'
main.cpp:(.text+0x62): undefined reference to `dlsym'
需要在編譯時加上-ldl。
將原來的編譯命令:g++ cfgfile.cpp create.cpp main.cpp -o main
修改爲:g++ cfgfile.cpp create.cpp main.cpp -o main -ldl

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章