为什么构建 Apache Thrift 会因“错误:找不到库"而失败? [英] Why does building Apache Thrift fail with "error: cannot find the library"?

查看:35
本文介绍了为什么构建 Apache Thrift 会因“错误:找不到库"而失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从 Apache Thriftthrift.apache.org/developers" rel="nofollow">官方 git 存储库 失败并显示找不到库...或未处理的参数"错误消息:

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
...

但是文件 libthrift.la 已构建并存在于文件系统中.使用 --without-tests 选项重新运行 configure 没有帮助.如何正确构建 Thrift?

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?

推荐答案

这是由于 libtool 的限制:它不能正确处理路径名中的空格.在这里,您已将源代码放置在Apache Thrift"的子文件夹中,通过仔细阅读上面粘贴的输出,您可以看到文件夹名称在其包含的空间中被错误地破坏了.

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

确保在重新运行 make 之前更新所有必需的文件.

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

这篇关于为什么构建 Apache Thrift 会因“错误:找不到库"而失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆