【问题标题】:Why does building Apache Thrift fail with "error: cannot find the library"?为什么构建 Apache Thrift 失败并显示“错误:找不到库”?
【发布时间】:2015-11-26 17:25:27
【问题描述】:

尝试从 the official git repository 中的源在 Fedora 23 上构建 Apache Thrift 失败,并显示“找不到库...或未处理的参数”错误消息:

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

【问题讨论】:

    标签: thrift libtool


    【解决方案1】:

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

    最简单的解决方案是重命名此文件夹以删除空间。之后,您需要运行

    make distclean
    ./bootstrap.sh
    

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

    【讨论】:

      猜你喜欢
      • 2021-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多