简体   繁体   English

linux上libtorrent的./configure问题

[英]problems with ./configure for libtorrent on linux

Hell I have been having an extremely tough time installing libtorrent and am unsure what the problems are. 地狱我在安装libtorrent时遇到了非常艰难的时间,我不确定问题是什么。 I have seen plenty similar errors online but the solutions were not helpful and I am pretty sure the error message is just too vague for comparison. 我在网上看到了很多类似的错误,但解决方案没有帮助,我很确定错误信息对于比较来说太模糊了。

When I run ./configure I get 当我跑./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

** **

I then use the suggestion and the difference is that the bottom says 然后我使用了这个建议,不同之处在于底部说的

** **

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 !

** **

the config.log file has an error 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

** **

Any insight would be enormously appreciated 任何见解都会受到极大的赞赏

after installing 安装后

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.

You need to install libboost-system. 您需要安装libboost-system。

If you are using Debian/Ubuntu, use apt-get as follows. 如果您使用的是Debian / Ubuntu,请使用apt-get,如下所示。

$ apt-get install libboost-system-dev

You may also need to install ... 您可能还需要安装......

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

The easiest way to install all the dependencies is with apt-get. 安装所有依赖项的最简单方法是使用apt-get。

sudo apt-get build-dep python-libtorrent

我知道这sudo apt-get install libssl-dev ,但要解决您的OpenSSL问题,您需要使用sudo apt-get install libssl-dev安装OpenSSL库。

For CentOS users, you will want to install boost-devel. 对于CentOS用户,您需要安装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: 只是想指出一件事,我使用的CentOS 6.4有一个旧的gcc编译器:

# 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. 安装更新版本的gcc帮助我摆脱了那个特定的错误。 I used g++ (GCC) 4.8.2 version and this time calling the following command worked: 我使用g ++(GCC)4.8.2版本,这次调用以下命令工作:

# ./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. 在此之后,您可能仍然遇到没有像在此处发布的OP那样找到openssl标头, 这篇文章将有助于克服错误。 You may have to install openssl-devel (for CentOS) or libssl-dev (for Debian), or you can run with 您可能必须安装openssl-devel(对于CentOS)或libssl-dev(对于Debian),或者您可以运行

# ./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. 如果您的系统中安装了openssl标头,则不需要使用--with-openssl标志,或者至少我不需要使用它。

Although this is old post, hope it will help someone else like me. 虽然这是老帖子,但希望它会帮助像我这样的其他人。

To avoid OpenSSL issues you can build "libtorrent-rasterbar" disabling OpenSSL encryption. 为了避免OpenSSL问题,您可以构建“libtorrent-rasterbar”来禁用OpenSSL加密。

For instance: 例如:

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

And then "make" + "make install" 然后“make”+“make install”

Regards 问候

The accepted answer didn't work for me. 接受的答案对我不起作用。 What did work was editing the configure script file and removing those lines from it: 编辑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

Those lines seemed to check that the BOOST_SYSTEM_LIB environment variable exists and is not empty. 这些行似乎检查BOOST_SYSTEM_LIB环境变量是否存在且不为空。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM