BeBeMo / lua-interact-with-cpp

0 stars 0 forks source link

Undefined reference to 'dlsym' and 'dlopen' #2

Open BeBeMo opened 5 years ago

BeBeMo commented 5 years ago

When compiling program using g++ version 5.4.0 , I get the undefined reference errors using the following command . g++ -o test test.cpp -I ../../slua/include/ -L ../../slua/lib/ ../../slua/lib/linux/liblua.a

BeBeMo commented 5 years ago

The solution is add -ldlflag at the end of command , like

g++ -o test test.cpp -I ../../slua/include/ -L ../../slua/lib/ ../../slua/lib/linux/liblua.a -ldl