Yay! I'm not a hardened Linux geek yet (but I aim to become
) and I've got some experience with Lua embedding in XP but know I'm stuck! I have a simple question (I think), but first I think I would fill in some information:
Distro:
Mandrake LE2005
GCC (gcc -v):
Reading specs from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/specs
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.4.3 (Mandrakelinux 10.2 3.4.3-7mdk)
Kdevelop:
Version 3.1.2
Lua:
Version 5.0
The thing is when I just link to liblua.a (-llua) it's ok, but as soon as I try to link liblualib.a (-llualib) into the project I get these errors:
Code:
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `log'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `sqrt'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `dlerror'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `dlclose'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `fmod'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `cos'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `sin'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `atan2'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `dlopen'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `pow'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `log10'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `dlsym'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `exp'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `tan'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `atan'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `asin'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/../../../liblualib.so: undefined reference to `acos'
The code I tried to compile:
Code:
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
lua_State* luavm;
int main (int argc, char *argv[])
{
luavm = lua_open();
lua_baselibopen(luavm);
lua_dofile(luavm, "hello.lua");
lua_close(luavm);
return 0;
}
When this small program starts it will load up the "hello.lua" script and execute it. This is the very basic way of lua embedding, but I can't even make that work. Pretty disturbing.. because dlopen, dlclose, exp, sqrt and all others work just fine when using them from my own code, if you get what I mean. What's going on?? I bet there is some simple thing that I've done wrong, but I'm doing the best I can to fix it - which usually ends up in total disaster....
Hmm... I guess I'm the worst kind of newbie