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
Autoconf Check for Program and Fail If Not Found
Diff Files Comparing Only First N Characters of Each Line
Write and Read from Ttyusb0, Can't Get Response
Linux - Modify File Modify/Access/Change Time
Why Is Git Creating Read-Only (444) Files
How to Store Your Github Https Password on Linux in a Terminal Keychain
Diff Files Inside of Zip Without Extracting It
Alternative to Valgrind (Memcheck) for Finding Leaks on Linux
Ubuntu/Fedora: How to Add Applications in The Menus
Linux/Unix Socket Self-Connection
On Building Docker Image Level=Error Msg="Can't Close Tar Writer: Io: Read/Write on Closed Pipe"
How to Edit a Symlink with a Text Editor
List of Files Modified 1 Hour Before
What Are The Lowest Possible Permissions for Typo3
Undefined Reference to Symbol 'Timer_Settime@@Glibc_2.3.3
Simplest Way to Build Dotnet Sdk Project Requiring Net461 on Macos