Hi, Chet

Thank you for your reply.

I tried following, and still rl_bind_key does not work.

1. Remove existing readline (editline) header files from /usr/include.

2. Change complie option as below
gcc -I/usr/local/Cellar/readline/6.3.6/include -lreadline sample.c

3. Check include order with gcc -v option

-----------------------------------------------------
$ gcc -I/usr/local/Cellar/readline/6.3.6/include -lreadline sample.c -v
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
 
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
-cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name sample.c -mrelocation-model pic
-pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu
core2 -target-linker-version 241.9 -v -resource-dir
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0
-I /usr/local/Cellar/readline/6.3.6/include -fdebug-compilation-dir
/Users/hanhan/dev/mssql -ferror-limit 19 -fmessage-length 0
-stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0
-fencode-extended-block-signature -fdiagnostics-show-option -vectorize-slp
-o /var/folders/mt/y45cf3x52mn57f3vcd2wfy040000gp/T/sample-dc2daf.o -x c
sample.c
clang -cc1 version 6.0 based upon LLVM 3.5svn default target
x86_64-apple-darwin13.4.0
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/Cellar/readline/6.3.6/include
 /usr/local/include
 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include
 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
 
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o a.out
-lreadline /var/folders/mt/y45cf3x52mn57f3vcd2wfy040000gp/T/sample-dc2daf.o
-lSystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.osx.a
----------------------------------------------------------

2014-11-10 9:01 GMT+09:00 Chet Ramey <[email protected]>:

> On 11/9/14 10:25 AM, Ryo Tomidokoro wrote:
> > Hi,
> >
> > I am trying to use rl_bind_key with a sample code below.
> > When I run the compiled binary and hit semi-colon key, it should print
> > [semi colon] instead of [;].
> > But it prints [;].
> >
> > This sample code properly works when I complied it on Cent-OS6.5
> (Readline
> > 6.0.4).
> >
> > Is this a bug? Or Is there any way to make it works?
> >
> >
> > [The version number and release status of Readline]
> > 6.3.6-release (installed via homebrew)
> >
> > [The machine and OS that it is running on]
> > Mac Book Air 2012 Mid
> > Mac OSX 10.9.5 (Mavericks)
> >
> > [A list of the compilation flags or the contents of `config.h', if
> appropriate]
> > N/A
> >
> > [a description of the bug]
> > rl_bind_key dose not work when compiled on Mac OSX.
>
>
> You're probably not getting the homebrew version of readline you just
> installed unless you use -L to specify the homebrew installation lib
> directory.
>
> Apple ships a crippled version of "readline" they derived from BSD
> editline in /usr/lib, and that's what you get with -lreadline.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, ITS, CWRU    [email protected]
> http://cnswww.cns.cwru.edu/~chet/
>
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to