I'm new at Lua and writing bindings in general. At the moment I'm just trying to compile the first example found here (with the functions updated to Lua 5.1).
#include <stdio.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
/* the Lua interpreter */
lua_State* L;
int main ( int argc, char *argv[] )
{
/* initialize Lua */
L = luaL_newstate();
/* load various Lua libraries */
luaL_openlibs(L);
luaopen_table(L);
luaopen_io(L);
luaopen_string(L);
luaopen_math(L);
/* cleanup Lua */
lua_close(L);
return 0;
}
When I compile using gcc -o init init.c -Wall -I/usr/local/include -L/usr/local/lib -llua -lliblua I get the following error:
.../../i486-pc-linux-gnu/bin/ld: cannot find -lliblua
collect2: ld returned 1 exit status
The file liblua.a is in /usr/local/lib, but for some reason the compiler can't find it? What am I doing wrong?