Search code examples
linkercompiler-errorslua

Lua compilation link error


When I try to compile a little lua program, I get these errors :

/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'

Of course, I link with -ldl. I have lua5.2-dev installed on my ubuntu. If you need any more infos ask me.

Thanks!


Solution

  • When I try to compile a little lua program, I get these errors

    No. You get these errors when you link the program.

    The fix is to add -ldl at the end of your link line.