4

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

3
  • 3
    Do you have ncurses installed? Dec 26, 2012 at 19:08
  • 12.04 is the Linux version
    – 0x12
    Dec 26, 2012 at 19:08
  • eh ncursers? ill check .
    – 0x12
    Dec 26, 2012 at 19:09

2 Answers 2

6

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).

1
  • Hey Thank you seems like now the Lua is compiling.
    – 0x12
    Dec 26, 2012 at 19:15
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.