lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>>>>> "Daryl" == Daryl Lee <daryl@daryllee.com> writes:

 Daryl> Greetings!
 Daryl> I have both an iMac and a Macbook pro laptop, both running
 Daryl> Mojave (OS X 10.14.1), both with XCode 10.1, both with command
 Daryl> line tools (gcc --version reports Apple LLVM version 10.0.0
 Daryl> (clang-1000.11.45.5)). Lua 5.3.5 builds and runs nicely on the
 Daryl> iMac, but fails on the Macbook, with several linker errors,
 Daryl> beginning with:

 Daryl> gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_MACOSX
 Daryl> -c 
 Daryl> -o lua.o lua.c
 Daryl> gcc -std=gnu99 -o lua   lua.o liblua.a -lm -lreadline
 Daryl> Undefined symbols for architecture x86_64:
 Daryl>   "_tgetent", referenced from:
 Daryl>       __rl_init_terminal_io in libreadline.a(terminal.o)
 Daryl>   "_tgetflag", referenced from:
 Daryl>       __rl_init_terminal_io in libreadline.a(terminal.o)
 Daryl>   "_tgetnum", referenced from:
 Daryl>       __rl_get_screen_size in libreadline.a(terminal.o)
 Daryl> ...

To link against a non-shared readline library, you'll need to also
specify whichever library provides termcap/terminfo functionality for
your system, typically -ltermcap or -ltinfo. (This is true for all apps
that try to link libreadline.a, not just lua; it doesn't apply when
linking a shared libreadline because the dependency is already set up
when the library was linked in that case.)

-- 
Andrew.