Why does building Apache Thrift fail with “error: cannot find the library”?

若如初见. 提交于 2019-12-13 10:33:01

问题


Trying to build Apache Thrift on Fedora 23 from the source in the official git repository fails with a "cannot find the library... or unhandled argument" error message:

...
make[5]: Entering directory '/home/ssouth/Source/Apache Thrift/git-wip-us.apache.org/repos/asf/thrift/lib/cpp/test'
/bin/sh ../../../libtool  --tag=CXX   --mode=link g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -L/usr/lib64  -o Benchmark Benchmark.o libtestgencpp.la -lssl -lcrypto -lrt -lpthread 
libtool:   error: cannot find the library 'Thrift/git-wip-us.apache.org/repos/asf/thrift/lib/cpp/libthrift.la' or unhandled argument 'Thrift/git-wip-us.apache.org/repos/asf/thrift/lib/cpp/libthrift.la'
Makefile:1049: recipe for target 'Benchmark' failed
make[5]: *** [Benchmark] Error 1
make[5]: Leaving directory '/home/ssouth/Source/Apache Thrift/git-wip-us.apache.org/repos/asf/thrift/lib/cpp/test'
Makefile:947: recipe for target 'all' failed
...

But the file libthrift.la is built and present on the filesystem. Re-running configure with the --without-tests option doesn't help. How can I make Thrift build correctly?


回答1:


This is due to a limitation of libtool: It does not correctly handle whitespace in path names. Here you've placed the source code in a subfolder of "Apache Thrift", and by reading carefully the output pasted above you can see the folder name is being incorrectly broken at the space it contains.

The easiest solution is to rename this folder to remove the space. Afterwards, you'll need to run

make distclean
./bootstrap.sh

to make sure all the necessary files are updated before re-running make.



来源:https://stackoverflow.com/questions/33944237/why-does-building-apache-thrift-fail-with-error-cannot-find-the-library

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