Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

libtool - Why does building Apache Thrift fail with "error: cannot find the library"?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...