LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-31-2016, 05:51 AM   #1
sithun
Member
 
Registered: Jul 2016
Location: mongolia, bulgan
Posts: 102

Rep: Reputation: 1
error when compile lua 5.3.3


i try to compile lua 5.3.3 using slackbuild with changed version and have this error:


Code:
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 lutf8lib.o loadlib.o linit.o 
ranlib liblua.a
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX    -c -o lua.o lua.c
gcc -std=gnu99 -o lua   lua.o liblua.a -lm -Wl,-E -ldl -lreadline 
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tputs'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `PC'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
/usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
Makefile:63: recipe for target 'lua' failed
make[2]: *** [lua] Error 1
make[2]: Leaving directory '/usr/src/lua-5.3.3/src'
Makefile:110: recipe for target 'linux' failed
make[1]: *** [linux] Error 2
make[1]: Leaving directory '/usr/src/lua-5.3.3/src'
Makefile:55: recipe for target 'linux' failed
make: *** [linux] Error 2

how to fix it?
 
Old 12-31-2016, 06:04 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,494
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
libreadline is failing to find certain functions from other libraries. tgoto and several others come from termcap. tputs is from ncurses. You should have both of these but maybe not in the right place.
 
Old 12-31-2016, 09:54 AM   #3
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
Just pass "-ncurses" in LDFLAGS. For completeness, this is the core of my slackbuild:

Code:
sed -i "s|/usr/local|/usr|" src/luaconf.h
sed -i "s|lib/lua|lib64/lua|" src/luaconf.h
sed -i "s|/usr/local|/usr|" etc/lua.pc
sed -i "s|prefix}/lib|prefix}/lib64|g" etc/lua.pc

make linux CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=/usr INSTALL_LIB=/usr/lib64 INSTALL_LMOD=/usr/share/lua/5.3 INSTALL_CMOD=/usr/lib64/lua/5.3 || exit 1
make linux install CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=$PKG/usr INSTALL_LIB=$PKG/usr/lib64 INSTALL_LMOD=$PKG/usr/share/lua/5.3 INSTALL_CMOD=$PKG/usr/lib64/lua/5.3 || exit 1

mkdir -p shared
cd shared
  ar -x $PKG/usr/lib64/liblua.a
  gcc -ldl -lreadline -lhistory -lncurses -lm -shared *.o -o liblua.so.$VERSION
  cp -a liblua.so.$VERSION $PKG/usr/lib64
  ( cd $PKG/usr/lib64
    ln -s liblua.so.$VERSION liblua.so.5.1
    ln -s liblua.so.$VERSION liblua.so.5
    ln -s liblua.so.$VERSION liblua.so
  )
cd ..
 
1 members found this post helpful.
Old 12-31-2016, 10:19 AM   #4
sithun
Member
 
Registered: Jul 2016
Location: mongolia, bulgan
Posts: 102

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by gengisdave View Post
Just pass "-ncurses" in LDFLAGS. For completeness, this is the core of my slackbuild:

Code:
sed -i "s|/usr/local|/usr|" src/luaconf.h
sed -i "s|lib/lua|lib64/lua|" src/luaconf.h
sed -i "s|/usr/local|/usr|" etc/lua.pc
sed -i "s|prefix}/lib|prefix}/lib64|g" etc/lua.pc

make linux CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=/usr INSTALL_LIB=/usr/lib64 INSTALL_LMOD=/usr/share/lua/5.3 INSTALL_CMOD=/usr/lib64/lua/5.3 || exit 1
make linux install CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" LDFLAGS="-lncurses" INSTALL_TOP=$PKG/usr INSTALL_LIB=$PKG/usr/lib64 INSTALL_LMOD=$PKG/usr/share/lua/5.3 INSTALL_CMOD=$PKG/usr/lib64/lua/5.3 || exit 1

mkdir -p shared
cd shared
  ar -x $PKG/usr/lib64/liblua.a
  gcc -ldl -lreadline -lhistory -lncurses -lm -shared *.o -o liblua.so.$VERSION
  cp -a liblua.so.$VERSION $PKG/usr/lib64
  ( cd $PKG/usr/lib64
    ln -s liblua.so.$VERSION liblua.so.5.1
    ln -s liblua.so.$VERSION liblua.so.5
    ln -s liblua.so.$VERSION liblua.so
  )
cd ..
thanks a lot. it helped
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to compile conky with lua support Stephen Morgan Slackware 2 03-03-2013 11:07 AM
[SOLVED] rpm build: syntax error near unexpected token `LUA,' mkarlsson Programming 16 03-04-2012 12:27 PM
[SOLVED] Undefined reference error when using Lua API MTK358 Programming 8 07-20-2011 07:14 PM
[SOLVED] Enemy Territory: Quake Wars LUA error on slackware 64? trademark91 Slackware 9 07-14-2011 07:03 PM
Trying to compile ASC and can't manage to get LUA 5.1 recognized storckm Linux - Software 4 11-13-2010 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration