lua-users home
lua-l archive

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


Not that I know anything about the cygwin environment, but don't you need
to add -lreadline somewhere in the link options?




                                                                                                    
                    Bansard Stephane                                                                
                    <p0665393@MAGELLAN.UMo        To:     Multiple recipients of list               
                    ntreal.CA>                    <lua-l@tecgraf.puc-rio.br>                        
                    Sent by:                      cc:                                               
                    owner-lua-l@tecgraf.pu        Subject:     USE_READLINE                         
                    c-rio.br                                                                        
                                                                                                    
                                                                                                    
                    07/12/01 12.04                                                                  
                    Please respond to                                                               
                    lua-l                                                                           
                                                                                                    
                                                                                                    




Hi all !

> Perhaps the easiest way is simply to edit lua.c and add #define
USE_READLINE
> somewhere near the top. Then run make again.
> Or edit config and add -DUSE_READLINE in POSIX.
I've tried both solutions without success. I have noticed that
#ifdef USE_READLINE
#include <readline/readline.h>
#include <readline/history.h> ...
has already been added to lua.c. So it should have worked out of the box,
right?
The error messages are reported below.

So the problem is with cygwin/gcc. Does anybody know how to configure gcc
to get
everything working in the cygwin environment?

Thanks again!
Stephane

The failure messages I got were:
1.
when moidifying config with POSIX= -D_POSIX_SOURCE -DUSE_READLINE
-->
gcc -O2 -ansi -pedantic -Wall -I../../include    -D_POSIX_SOURCE
-DUSE_READLINE
-c -o lua.o lua.c
gcc -o ../../bin/lua  lua.o -L../../lib -llua -llualib -lm
lua.o(.text+0x68e):lua.c: undefined reference to `_imp__readline'
lua.o(.text+0x7da):lua.c: undefined reference to `_imp__add_history'
collect2: ld returned 1 exit status
make[1]: *** [../../bin/lua] Error 1
make[1]: Leaving directory `/cygdrive/c/<mypath>/lua-4.1-work/src/lua'
make: *** [all] Error 2

2.
when modifying lua.c with #define USE_READLINE

gcc -o ../../bin/lua  lua.o -L../../lib -llua -llualib -lm
lua.o(.text+0x68e):lua.c: undefined reference to `_imp__readline'
lua.o(.text+0x7da):lua.c: undefined reference to `_imp__add_history'
collect2: ld returned 1 exit status
make[1]: *** [../../bin/lua] Error 1
make[1]: Leaving directory `/cygdrive/c/<mypath>/lua-4.1-work/src/lua'
make: *** [all] Error 2