【问题标题】:libtool error building thrift 0.9.1 on Ubuntu 13.04在 Ubuntu 13.04 上构建 thrift 0.9.1 时出现 libtool 错误
【发布时间】:2013-09-09 17:16:22
【问题描述】:

在 Ubuntu 13.04 上构建 thrift 0.9.1(支持 C、C++、java、C#、perl、python)我收到此错误。

./configure 不带任何选项运行,make 不带任何选项运行...

Making all in test
make[2]: Entering directory `/home/dvb/sw/thrift-0.9.1/test'
Making all in nodejs
make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/nodejs'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test/nodejs'
Making all in cpp
make[3]: Entering directory `/home/dvb/sw/thrift-0.9.1/test/cpp'
Makefile:832: warning: overriding commands for target `gen-cpp/ThriftTest.cpp'
Makefile:829: warning: ignoring old commands for target `gen-cpp/ThriftTest.cpp'
/bin/bash ../../libtool --tag=CXX   --mode=link g++ -Wall -g -O2 -L/usr/lib   -o libtestgencpp.la  ThriftTest_constants.lo ThriftTest_types.lo ../../lib/cpp/libthrift.la -lssl -lcrypto -lrt -lpthread 
libtool: link: ar cru .libs/libtestgencpp.a .libs/ThriftTest_constants.o .libs/ThriftTest_types.o 
ar: .libs/ThriftTest_constants.o: No such file or directory
make[3]: *** [libtestgencpp.la] Error 1
make[3]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/dvb/sw/thrift-0.9.1/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dvb/sw/thrift-0.9.1'
make: *** [all] Error 2
dvb@dvb-u13:~/sw/thrift-0.9.1$ 

【问题讨论】:

  • 在不支持 c++ 的情况下配置 (./configure -with-cpp=no) 使运行成功完成。这似乎是关于 libtool 的路径问题; ThriftTest_constants.o 存在。
  • 在 Ubuntu 13.10 上同样的问题。如上所述,通过删除 c++ 支持来解决。

标签: c++ compilation thrift


【解决方案1】:

虽然这似乎是 0.9.1 版本 tarball 中的一个缺陷,但截至今天下午,通过 git 拉取的树的顶部不是问题。

如果遇到此问题,解决方案是使用更新版本的 thrift,直接通过 git 获取源代码树,而不是下载 tarball。构建的唯一区别是您需要在配置之前运行 bootstrap.sh。这是有据可查的。

请注意另外两个有用的数据位: 1. 配置构建 --without-tests(下面是 Mike Johnson - 谢谢) 2. 这个问题在 0.9.2 版本中得到修复(卢克在下面-谢谢!)

【讨论】:

  • 这在哪里有据可查?因为目前我在下载 tar.gz 后找不到任何关于如何处理 thrift 的信息,我必须进行配置和制作,然后我遇到了和你一样的问题,但是我先运行 bootstrap,它没有任何改变
  • git clone git-wip-us.apache.org/repos/asf/thrift.git thrift; cd 节俭。然后像在 tarball 上一样运行引导程序和配置
  • 谢谢小费。如果您直接使用 tar 文件,请从 git 获取源代码,然后运行 ​​./bootstrap.sh。最后,只需压缩 thrift 文件夹,它就可以工作了
【解决方案2】:

我今晚遇到了这个问题并“修复”了它。问题是 ar(1) 在目录 test/cpp/.libs 中找不到 .o 文件。我确信 test/cpp 中的 Makefile.am 中缺少一些魔法,但我既没有耐心也没有 automake-fu 来修复它。

相反,我只是将 .o 文件从 test/cpp 符号链接到 test/cpp/.libs/。这修复了 C++ 测试的构建。

cd thrift-0.9.1/test/cpp/.libs
for i in ../*.o; do echo $i; ln -s $i .; done

【讨论】:

    【解决方案3】:

    Thrift 发布后出现了这个编译问题。您可以选择跳过编译测试:

    ./configure --without-tests
    

    【讨论】:

      【解决方案4】:

      你也可以试试这个:

      ./configure 
      (cd test/cpp; ln -s . .libs)
      make install
      

      这将简单地将 .libs 链接回 test/cpp。 "ar" 会在那里找到文件。

      【讨论】:

        【解决方案5】:

        David V 说得对,0.9.1 坏了,但 0.9.2 有效。构建说明似乎也是一个断开的链接。所以这里是对我有用的命令,来自全新的 Ubuntu 安装:

        # Install java if you don't have it
        sudo apt-get install default-jre
        # install build dependencies
        sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev 
        cd /tmp 
        curl http://archive.apache.org/dist/thrift/0.9.2/thrift-0.9.2.tar.gz | tar zx 
        cd thrift-0.9.2/ 
        ./configure 
        make 
        sudo make install 
        #test that it can run
        thrift --help 
        

        (感谢 these 有用的说明;我刚刚将 0.9.1 替换为 0.9.2)

        【讨论】:

          【解决方案6】:

          我碰巧遇到了这个问题。您可以尝试 cp all test/cpp/*.o 到 .libs 文件夹。

          或者你可以跳过编译测试。

          cp test/cpp/*.o test/cpp/.libs/
          

          【讨论】:

          • 我认为,当您为您的意图添加一些解释时,这对 OP 和更多访问者会更有帮助。
          猜你喜欢
          • 1970-01-01
          • 2015-10-13
          • 1970-01-01
          • 2013-07-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-07-08
          • 2019-09-07
          相关资源
          最近更新 更多