|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-10 22:41 UTC] notfornoone at gmail dot com
Description:
------------
When compiling on 10.6 with the following configure args the build fails:
./configure '--prefix=/Users/me/Desktop/php54test' '--disable-all' '--with-
apxs2=/usr/sbin/apxs' '--with-readline=/usr/local/Cellar/readline/6.2.1'
make
Fails with this error:
Undefined symbols for architecture x86_64:
"_rl_on_new_line", referenced from:
_zif_readline_on_new_line in readline.o
"_history_list", referenced from:
_zif_readline_list_history in readline.o
"_rl_mark", referenced from:
_zif_readline_info in readline.o
"_rl_pending_input", referenced from:
_zif_readline_info in readline.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
I've also tried:
* Using an earler version of readline (6.1) fails with the same error
* Compiling on 10.7 Lion results in the same error
* Using the same configure options using the 5.3 branch builds fine
* Compiling with configure options "--with-libedit" enabled instead of the "--
with-readline" option builds fine
Patchesreadline_x86_64_fix (last revision 2012-11-22 07:14 UTC by phpnet at jigsoft dot co dot za)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 11:00:01 2025 UTC |
I had a similar problem, and this bug came up in my Google search results. To help anyone else with the solution, I'll post the problem and solution here. Here's what my build output contained when trying to add '--with-readline': Undefined symbols: "_rl_completion_matches", referenced from: __readline_completion_cb in readline.o _cli_code_completion in readline_cli.o "_rl_mark", referenced from: _rl_mark$non_lazy_ptr in readline.o "_rl_on_new_line", referenced from: _zif_readline_on_new_line in readline.o "_rl_pending_input", referenced from: _rl_pending_input$non_lazy_ptr in readline.o "_history_list", referenced from: _zif_readline_list_history in readline.o ld: symbol(s) not found collect2: ld returned 1 exit status From what I can tell, the problem building --with-readline on a Mac is that libreadline.dylib in /usr/lib is not technically the readline library. It's a symlink to libedit.dylib in the same directory. So I managed to install another, actual readline library using fink (you could compile it yourself), and temporarily changed the symlink in /usr/lib: me:/usr/lib # unlink libreadline.dylib me:/usr/lib # ln -s /path/to/my/other/libreadlinelib.dylib libreadline.dylib once that's done, it builds and links. you can put back the old symlink once you're done: me:/usr/lib # unlink libreadline.dylib me:/usr/lib # ln -s libedit.dylib libreadline.dylib