Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lua Setup error

Hi I ve downloaded lua extracted it and tried to make it

sg1@kalanamith:~/lua-5.2.1$ make linux test

after that um getting this error

ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o     lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o     lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o     lstrlib.o ltablib.o loadlib.o linit.o 
ranlib liblua.a
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lua.o lua.c    
gcc -o lua   lua.o liblua.a -lm -Wl,-E -ldl -lreadline -lncurses 
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[2]: Leaving directory `/home/sg1/lua-5.2.1/src'
make[1]: *** [linux] Error 2   
make[1]: Leaving directory `/home/sg1/lua-5.2.1/src'
make: *** [linux] Error 2

This is my first day with Lua so Ill be great full if any one can give me a help. thank you in advance

like image 511
Gayan Kalanamith Avatar asked Feb 18 '23 01:02

Gayan Kalanamith


2 Answers

Looks like you're missing the ncurses library. Make sure you've got all dependencies installed, e.g. by using sudo apt-get install libncurses-dev (might depend on your system/version).

like image 87
Mario Avatar answered Feb 24 '23 05:02

Mario


Apply the patch used to compile the Debian/Ubuntu package:

Index: lua5.2-5.2.0.obsolete.0.298371916710497/src/Makefile
===================================================================
--- lua5.2-5.2.0.obsolete.0.298371916710497.orig/src/Makefile   2012-05-04 16:27:35.000000000 +0200
+++ lua5.2-5.2.0.obsolete.0.298371916710497/src/Makefile    2012-05-04 16:27:35.000000000 +0200
@@ -103,7 +103,7 @@
 generic: $(ALL)

 linux:
-   $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
+   $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"

 macosx:
    $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"

Original source: http://patch-tracker.debian.org/patch/series/view/lua5.2/5.2.1-3/no-ncurses-dependency.patch

Cheers

like image 38
Enrico Avatar answered Feb 24 '23 06:02

Enrico