6

地狱,我在安装 libtorrent 时遇到了非常困难的时间,并且不确定问题出在哪里。我在网上看到了很多类似的错误,但解决方案没有帮助,我很确定错误消息太模糊,无法比较。

当我运行 ./configure 我得到

**

Building libtorrent-rasterbar 0.16.5

Checking for a C/C++ compiler to use:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether g++ understands -c and -o together... yes
.
..
.
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
configure: error: Boost.System library not found. Try using --with-boost-system=lib

**

然后我使用这个建议,不同的是底部说

**

Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
checking for exit in -llib... no
checking for exit in -lboost_system-lib... no
configure: error: Could not link against boost_system-lib !

**

config.log 文件有错误

**

configure:16572: result: no
configure:16537: checking for exit in -lboost_system-lib
configure:16562: gcc -o conftest -lpthread -g -O2 -fvisibility=hidden  -I/usr/include  -L/usr/lib conftest.c -lboost_system-lib  -lpthread   >&5
conftest.c:33: warning: conflicting types for built-in function 'exit'
/usr/bin/ld: cannot find -lboost_system-lib
collect2: ld returned 1 exit status

**

任何见解将不胜感激

安装后

apt-get install libboost-system-dev

apt-get install libboost-filesystem-dev libboost-thread-dev

Checking features to be enabled:
checking whether encryption support should be enabled... yes
configure: encryption support: now checking for the OpenSSL library...
checking for pkg-config... /usr/bin/pkg-config
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
configure: error: OpenSSL library not found. Try using --with-openssl=DIR or disabling encryption at all.
4

6 回答 6

11

您需要安装 libboost 系统。

如果您使用的是 Debian/Ubuntu,请按如下方式使用 apt-get。

$ apt-get install libboost-system-dev

您可能还需要安装...

$ apt-get install libboost-filesystem-dev libboost-thread-dev
于 2012-10-24T22:05:32.700 回答
4

安装所有依赖项的最简单方法是使用 apt-get。

sudo apt-get build-dep python-libtorrent
于 2013-03-28T01:55:08.987 回答
3

我知道这有点老了,但要解决您的 OpenSSL 问题,您需要使用sudo apt-get install libssl-dev.

于 2015-01-25T03:09:20.163 回答
2

For CentOS users, you will want to install boost-devel.

# yum install boost-devel

But I still got the same error. Just want to point out one more thing, the CentOS 6.4 I work with had an old gcc compiler:

# g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Installing a newer version of gcc helped me to get rid of that particular error. I used g++ (GCC) 4.8.2 version and this time calling the following command worked:

# ./configure --with-boost-libdir=/usr/lib64

After this point you might still run into not finding openssl headers like the OP posted here, this post will help to overcome the error. You may have to install openssl-devel (for CentOS) or libssl-dev (for Debian), or you can run with

# ./configure --with-boost-libdir=/usr/lib64 --without-ssl

If you have openssl headers installed in your system, you don't need to use --with-openssl flag, or at least I didn't need to use it.

Although this is old post, hope it will help someone else like me.

于 2015-01-19T06:45:26.610 回答
0

为避免 OpenSSL 问题,您可以构建“libtorrent-rasterbar”来禁用 OpenSSL 加密。

例如:

./configure --disable-debug --disable-encryption --prefix=/opt/libtorrent-rasterbar

然后“制作”+“制作安装”

问候

于 2016-03-18T01:25:45.070 回答
0

接受的答案对我不起作用。起作用的是编辑configure脚本文件并从中删除这些行:

if test -z "$BOOST_SYSTEM_LIB"; then :
  as_fn_error $? "Boost.System library not found. Try using --with-boost-system=lib" "$LINENO" 5
fi

这些行似乎检查了 BOOST_SYSTEM_LIB 环境变量是否存在且不为空。

于 2017-01-15T20:55:40.670 回答