lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi, I tried calling lua functions in my C++ program and compile it with
gcc... (I use .cpp extension)
But then I get the following errors:

/tmp/ccEU0sMk.o: In function `startScript(void)':
/tmp/ccEU0sMk.o(.text+0x1c): undefined reference to `lua_open(int)'
/tmp/ccEU0sMk.o(.text+0x39): undefined reference to `lua_dofile(lua_State *,
char const *)'
/tmp/ccEU0sMk.o(.text+0x4f): undefined reference to `lua_getglobal(lua_State
*, char const *)'
/tmp/ccEU0sMk.o(.text+0x63): undefined reference to `lua_gettop(lua_State
*)'
/tmp/ccEU0sMk.o(.text+0x74): undefined reference to `lua_tonumber(lua_State
*, int)'

If I rename my file with lua commands to script.c there is no problem

Isn't there a way to use lua in c++ ? My whole prog is written in C++ so I
would like to use that...

thanks,

Bram Vaessen