Srlua Makefile Error Lua.H No Such File or Directory

srlua makefile error lua.h No such file or directory

I doubt that sudo will help. The issue is that GCC can't locate lua.h, which implies that you haven't told it where to find the developer files needed to compile programs that link against the Lua core. You likely need to identify a folder such as /usr/local/lua/include.

It is also likely that you have the Lua executable package installed, but not the developer package. If so, you will need to locate and install that package. A command like


$ apt-get install liblua5.1-0-dev

does that for Lua 5.1.

If you are building Lua 5.2 from source, then you have all the files you need, you just need to tell srlua's makefile where to find them.

I've successfully built and used srlua on Windows with Lua 5.1, but have not needed to try this on Ubuntu yet, so I can't be a whole lot more specific.

Update:

From your pastebin, try this:

# these will probably work if Lua has been installed globally
LUA= /usr/include/lua5.1
LUAINC= /usr/include/lua5.1
LUALIB= /usr/lib/lua/5.1
LUABIN= /usr/bin

You had typo in the definition of $(LUAINC). You will need to locate liblua.a and name the right folder in the definition of $(LUALIB). I don't have the lua dev packages installed on my handy Ubuntu box, so I'm not certain where it got put.

Update 2: You are getting closer, since you have got past the compiler configuration and into the linker configuration issues.

On my Ubuntu box, Lua's library appears to be /usr/lib/liblua5.1.a, and there is no file named liblua.a. So for me -llua cannot work. I was able to compile a simplest possible "hello world"...

#include "lua.h"
#include "lauxlib.h"
int main(int argc, char **argv)
{
lua_State *L = luaL_newstate();
luaL_openlibs(L);
luaL_dostring(L, "print('hello, '.._VERSION)");
return 0;
}

with the command


$ gcc -I/usr/include/lua5.1 -o hello hello.c -llua5.1 -lm
$ ./hello
hello, Lua 5.1
$

Perhaps you should make a similar minimal example work, then go back to tweaking the srlua makefile.

Node.js and Travis CI: can't find lua.h when installing node-lua package

In case anyone ever comes across this in the future, here's the PR solved the issue.

https://github.com/South-Paw/warframe-item-list/pull/41/files



Related Topics



Leave a reply



Submit