qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.15k stars 3.97k forks source link

Build error on Linux 4.0.1, Qt version? #7863

Closed tomfisk closed 6 years ago

tomfisk commented 6 years ago

I suspect the required version of Qt or Boost has changed with 4.0/4.0.1? I get the following error when trying to build qbittorrent-nox:

linking qbittorrent-nox filterparserthread.o: In function parseIPAddress': /root/qbittorrent-4.0.1/src/base/bittorrent/private/filterparserthread.cpp:97: undefined reference toboost::asio::ip::address_v4::address_v4(std::array<unsigned char, 4u> const&)' collect2: error: ld returned 1 exit status

Please provide the following information

qBittorrent version and Operating System

4.0.1, Linux

If on linux, libtorrent and Qt version

Qt 5.7.1

zeule commented 6 years ago

Please tell how do you compile qBt and boost. You can search for existing issues using "address_v4::address_v4". The first guess would be that your boost was compiled not in C++11 mode.

tomfisk commented 6 years ago

I installed boost from the debian distribution (1.55) so no build was involved there.

Qt...I assume that is this option in the configure?

-c++std <edition> .. Compile Qt with C++ standard edition (c++11, c++14, c++1z)
                     Default: highest supported

I have gcc (Debian 4.9.2-10) 4.9.2

zeule commented 6 years ago

Why do you ask about Qt?

I installed boost from the debian distribution

You can try to find C++11 export symbols in its libs to test whether it was compiled in C++11:

$ nm -D /usr/lib64/libboost_date_time.so | c++filt | grep __cxx11

You have to make sure that libtorrent was compiled in C++11 mode too:

$ nm -D /usr/lib/libtorrent-rasterbar.so | c++filt | grep std::chrono

Both commands have to return something if conditions are met.

tomfisk commented 6 years ago

Building libtorrent in C++11 mode fixed it. Thanks!

zeule commented 6 years ago

You are welcome.

chasen-bettinger commented 6 years ago

@tomfisk @evsh How do you build libtorrent in C++11 mode? New to Linux, I am lost

$ nm -D /usr/lib64/libboost_date_time.so | c++filt | grep __cxx11

This returns

nm: '/usr/lib64/libboost_date_time.so': No such file

thalieht commented 6 years ago

@chasen-bettinger https://github.com/qbittorrent/qBittorrent/wiki/Compiling-qBittorrent-on-Debian-and-Ubuntu#libtorrent The ./configure .... CXXFLAGS=-std=c++11 part to be specific.

chasen-bettinger commented 6 years ago

https://i.imgur.com/4pz0CGZ.png

Got even more errors. Not idea where I went wrong. Guess I'll try to start at step 0

tomfisk commented 6 years ago

Here is my configure command on Debian Jessie armhf

./configure --disable-debug --enable-encryption --with-libgeoip=system --with-boost-libdir=/usr/lib/arm-linux-gnueabihf CXXFLAGS=-std=c++11