hi
i am having a problem integrating Lua into C++. I found a discussion about it here but it didn't help me. i have installed lua and i can see it in /usr/include and /usr/lib and /usr/bin
i created the same code as the previous descussion
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
int main()
{
int s=0;
lua_State *L = lua_open();
// load the libs
luaL_openlibs(L);
//run a Lua scrip here
luaL_dofile(L,"test.lua");
printf("\nI am done with Lua in C++.\n");
lua_close(L);
return 0;
}
the compile command that i use
gcc -llua lpeg_test.cpp
i get
/tmp/ccsSzCTD.o: In function `main':
lpeg_test.cpp:(.text+0x10): undefined reference to `luaL_newstate()'
lpeg_test.cpp:(.text+0x1d): undefined reference to `luaL_openlibs(lua_State*)'
lpeg_test.cpp:(.text+0x2b): undefined reference to `luaL_loadfile(lua_State*, char const*)'
lpeg_test.cpp:(.text+0x47): undefined reference to `lua_pcall(lua_State*, int, int, int)'
lpeg_test.cpp:(.text+0x5a): undefined reference to `lua_close(lua_State*)'
/tmp/ccsSzCTD.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
can someone tell me what am i doing wrong ??