How to fix ranlib/libtool error when running make

三世轮回 提交于 2020-03-22 09:45:10

问题


I'm getting recurring errors when using make on Mac OS Mountain Lion v10.8.4.

I tried to install libev, and, after running ./configure, I ran make and got:

libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libev.4.dylib  .libs/ev.o .libs/event.o    -O3   -install_name  /usr/local/lib/libev.4.dylib -compatibility_version 5 -current_version 5.0 -Wl,-single_module
libtool: link: dsymutil .libs/libev.4.dylib || :
libtool: link: (cd ".libs" && rm -f "libev.dylib" && ln -s "libev.4.dylib" "libev.dylib")
libtool: link: ar cru .libs/libev.a  ev.o event.o
ranlib: unrecognized option `-q'
ranlib: Try `ranlib --help' for more information.
ar: internal ranlib command failed
make[1]: *** [libev.la] Error 1
make: *** [all] Error 2

I see a pattern because when I run make when trying to install httpd I get this error:

libtool: link: rm -fr  .libs/libev.4.dylib .libs/libev.4.dylib.dSYM .libs/libev.a .libs/libev.dylib
libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libev.4.dylib  .libs/ev.o .libs/event.o    -O3   -install_name  /usr/local/lib/libev.4.dylib -compatibility_version 5 -current_version 5.0 -Wl,-single_module
libtool: link: dsymutil .libs/libev.4.dylib || :
libtool: link: (cd ".libs" && rm -f "libev.dylib" && ln -s "libev.4.dylib" "libev.dylib")
libtool: link: ar cru .libs/libev.a  ev.o event.o
ranlib: unrecognized option `-q'
ranlib: Try `ranlib --help' for more information.
ar: internal ranlib command failed
make[1]: *** [libev.la] Error 1
make: *** [all] Error 2

It looks like I have an issue with ranlib but I'm not sure how to fix it. I saw somewhere that I should reinstall my developer tools, so I did but it hasn't helped.


回答1:


First the obvious actions: make sure you have the latest libev release, and Xcode is up to date. The configure system seems outdated, as it detects the (my) host system as i386-apple-darwin12.4.0 rather than x86_64-apple-darwin12.4.0. Though it still seemed to build.

If you have the autotools installed, e.g., autoconf-2.69, automake-1.13.3, and libtool-2.4.2 (which is typically installed as glibtool on OS X), you can run the included autoreconf command with: sh autogen.sh to refresh the configure system. It will issue a few warnings that can be ignored.

./configure CC="clang" CFLAGS="-pipe -W -Wall -O2 [-march=core2]"

Xcode -> Preferences -> Downloads -> Components :

check and install "Command Line Tools if you haven't already, which might be enough. If you still have a terminal open through the process, type the rehash command. Possibly you've done all this, but some Mac developers never leave the IDE.



来源:https://stackoverflow.com/questions/17263588/how-to-fix-ranlib-libtool-error-when-running-make

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!