Thanks ^^.
But still having trouble to compile successful =(.
I installed everything that has lua and dev in the name and then I used lua-config --libs to see which libraries I had to use to compile and then I used lua-config --include to see the path where Lua is located, buuut it still don't compile =(.
Here is what I have:
Code:
extern "C" {
#include <lua50/lua.h>
#include <lua50/lauxlib.h>
#include <lua50/lualib.h>
}
int main(int argc, char** argv)
{
lua_State* L = luaL_newstate();
luaL_dostring(L, "a = 10 + 5");
lua_getglobal(L, "a");
int i = lua_tointeger(L, -1);
printf("%d\n", i);
lua_close(L);
return 0;
}
Code:
zequez@zequez:~/Lua$ lua-config --libs
-L/usr/include -llualib50 -llua50
zequez@zequez:~/Lua$ lua-config --include
-I/usr/include/lua50
zequez@zequez:~/Lua$ g++ main.cpp -llua50 -llualib50
main.cpp: In function ‘int main(int, char**)’:
main.cpp:9: error: ‘luaL_newstate’ was not declared in this scope
main.cpp:11: error: ‘luaL_dostring’ was not declared in this scope
main.cpp:13: error: ‘lua_tointeger’ was not declared in this scope
Any clue?
Sorry for my English =P
Bookmarks