qBittorrent (latest from github) won't compile #5768

Closed
opened 2026-02-21 18:02:12 -05:00 by deekerman · 8 comments
Owner

Originally created by @WaterSibilantFalling on GitHub (Jul 11, 2017).

qBittorrent version and Operating System:

Linux 4.9.0-2-686-pae #1 SMP Debian 4.9.18-1 (2017-03-30) i686 GNU/Linux
gcc version 6.3.0 20170516 (Debian 6.3.0-18)

If on linux, libtorrent and Qt version:

libtorrent: just built and installed. 1.2.0, which works
got the libtorrent code from git clone https://github.com/arvidn/libtorrent.git
got the qBitorrent code from git clone https://github.com/qbittorrent/qBittorrent.git

What is the problem:

build error


prompt> make
compiling base/logger.cpp
compiling base/settingsstorage.cpp
compiling base/preferences.cpp
compiling base/iconprovider.cpp
compiling base/http/connection.cpp
compiling base/http/requestparser.cpp
compiling base/http/responsegenerator.cpp
compiling base/http/server.cpp
compiling base/http/responsebuilder.cpp
compiling base/net/dnsupdater.cpp
compiling base/net/downloadmanager.cpp
compiling base/net/downloadhandler.cpp
compiling base/net/geoipmanager.cpp
compiling base/net/portforwarder.cpp
compiling base/net/proxyconfigurationmanager.cpp
compiling base/net/reverseresolution.cpp
compiling base/net/smtp.cpp
compiling base/net/private/geoipdatabase.cpp
compiling base/bittorrent/infohash.cpp
base/bittorrent/infohash.cpp: In constructor ‘BitTorrent::InfoHash::InfoHash(const sha1_hash&)’:
base/bittorrent/infohash.cpp:43:43: error: invalid operands of types ‘std::size_t() {aka unsigned int()}’ and ‘int’ to binary ‘operator*’
     char out[(libtorrent::sha1_hash::size * 2) + 1];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
base/bittorrent/infohash.cpp:44:5: error: ‘to_hex’ is not a member of ‘libtorrent’
     libtorrent::to_hex(reinterpret_cast<const char*>(&m_nativeHash[0]), libtorrent::sha1_hash::size, out);
     ^~~~~~~~~~
base/bittorrent/infohash.cpp:44:102: error: ‘out’ was not declared in this scope
 reinterpret_cast<const char*>(&m_nativeHash[0]), libtorrent::sha1_hash::size, out);
                                                                               ^~~
base/bittorrent/infohash.cpp: In constructor ‘BitTorrent::InfoHash::InfoHash(const QString&)’:
base/bittorrent/infohash.cpp:54:19: error: ‘from_hex’ is not a member of ‘libtorrent’
         m_valid = libtorrent::from_hex(raw.constData(), 40, reinterpret_cast<char*>(&m_nativeHash[0]));
                   ^~~~~~~~~~
Makefile:2512: recipe for target 'infohash.o' failed
make[1]: *** [infohash.o] Error 1
make[1]: Leaving directory '/.hw/home/bench/coding/qbt/qBittorrent/src'
Makefile:42: recipe for target 'sub-src-make_first' failed
make: *** [sub-src-make_first] Error 2

libtorrent confiure
./configure --enable-debug --with-boost-libdir=/usr/lib/i386-linux-gnu/

qBitorrent configure, with and without c++ 11
either:

./configure --prefix=/usr/local  --with-boost-libdir=/usr/lib/i386-linux-gnu/ \ 
            --enable-encryption CXXFLAGS=-std=c++11 \                               
            --libdir=/usr/lib/i386-linux-gnu/ \                                     
            --enable-debug      

or:

  ./configure --prefix=/usr/local  --with-boost-libdir=/usr/lib/i386-linux-gnu/ \ 
            --enable-encryption  \                             
            --libdir=/usr/lib/i386-linux-gnu/ \                                     
            --enable-debug                
Originally created by @WaterSibilantFalling on GitHub (Jul 11, 2017). ### qBittorrent version and Operating System: Linux 4.9.0-2-686-pae #1 SMP Debian 4.9.18-1 (2017-03-30) i686 GNU/Linux gcc version 6.3.0 20170516 (Debian 6.3.0-18) ### If on linux, libtorrent and Qt version: libtorrent: just built and installed. 1.2.0, which works got the libtorrent code from ```git clone https://github.com/arvidn/libtorrent.git ``` got the qBitorrent code from ``` git clone https://github.com/qbittorrent/qBittorrent.git ``` ### What is the problem: build error ``` prompt> make compiling base/logger.cpp compiling base/settingsstorage.cpp compiling base/preferences.cpp compiling base/iconprovider.cpp compiling base/http/connection.cpp compiling base/http/requestparser.cpp compiling base/http/responsegenerator.cpp compiling base/http/server.cpp compiling base/http/responsebuilder.cpp compiling base/net/dnsupdater.cpp compiling base/net/downloadmanager.cpp compiling base/net/downloadhandler.cpp compiling base/net/geoipmanager.cpp compiling base/net/portforwarder.cpp compiling base/net/proxyconfigurationmanager.cpp compiling base/net/reverseresolution.cpp compiling base/net/smtp.cpp compiling base/net/private/geoipdatabase.cpp compiling base/bittorrent/infohash.cpp base/bittorrent/infohash.cpp: In constructor ‘BitTorrent::InfoHash::InfoHash(const sha1_hash&)’: base/bittorrent/infohash.cpp:43:43: error: invalid operands of types ‘std::size_t() {aka unsigned int()}’ and ‘int’ to binary ‘operator*’ char out[(libtorrent::sha1_hash::size * 2) + 1]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ base/bittorrent/infohash.cpp:44:5: error: ‘to_hex’ is not a member of ‘libtorrent’ libtorrent::to_hex(reinterpret_cast<const char*>(&m_nativeHash[0]), libtorrent::sha1_hash::size, out); ^~~~~~~~~~ base/bittorrent/infohash.cpp:44:102: error: ‘out’ was not declared in this scope reinterpret_cast<const char*>(&m_nativeHash[0]), libtorrent::sha1_hash::size, out); ^~~ base/bittorrent/infohash.cpp: In constructor ‘BitTorrent::InfoHash::InfoHash(const QString&)’: base/bittorrent/infohash.cpp:54:19: error: ‘from_hex’ is not a member of ‘libtorrent’ m_valid = libtorrent::from_hex(raw.constData(), 40, reinterpret_cast<char*>(&m_nativeHash[0])); ^~~~~~~~~~ Makefile:2512: recipe for target 'infohash.o' failed make[1]: *** [infohash.o] Error 1 make[1]: Leaving directory '/.hw/home/bench/coding/qbt/qBittorrent/src' Makefile:42: recipe for target 'sub-src-make_first' failed make: *** [sub-src-make_first] Error 2 ``` libtorrent confiure ```./configure --enable-debug --with-boost-libdir=/usr/lib/i386-linux-gnu/ ``` qBitorrent configure, with and without c++ 11 either: ``` ./configure --prefix=/usr/local --with-boost-libdir=/usr/lib/i386-linux-gnu/ \ --enable-encryption CXXFLAGS=-std=c++11 \ --libdir=/usr/lib/i386-linux-gnu/ \ --enable-debug ``` or: ``` ./configure --prefix=/usr/local --with-boost-libdir=/usr/lib/i386-linux-gnu/ \ --enable-encryption \ --libdir=/usr/lib/i386-linux-gnu/ \ --enable-debug ```
Author
Owner

@thalieht commented on GitHub (Jul 11, 2017):

qbit officially supports libtorrent's RC_1_0 branch. It's planned to move to RC_1_1 at some point in 3.4.x but you can use it already.
P.S. There is PR #6011 but it's outdated.

@thalieht commented on GitHub (Jul 11, 2017): qbit officially supports libtorrent's `RC_1_0` branch. It's planned to move to `RC_1_1` at some point in 3.4.x but you can use it already. P.S. There is PR #6011 but it's outdated.
Author
Owner

@WaterSibilantFalling commented on GitHub (Jul 11, 2017):

So I am building version 3.4.0 of qBittorrnet and version 1.2.0 of libtorrent.

Are those compatible?

@WaterSibilantFalling commented on GitHub (Jul 11, 2017): So I am building version 3.4.0 of qBittorrnet and version 1.2.0 of libtorrent. Are those compatible?
Author
Owner

@thalieht commented on GitHub (Jul 11, 2017):

No. qbittorrent 3.4.0 and libtorrent 1.1.4 are.

@thalieht commented on GitHub (Jul 11, 2017): No. qbittorrent 3.4.0 and libtorrent 1.1.4 are.
Author
Owner

@WolfganP commented on GitHub (Jul 11, 2017):

I'm also having linking issues building latest qB (https://github.com/qbittorrent/qBittorrent/issues/5608), but can't pinpoint where the issue is. Any help?

@WolfganP commented on GitHub (Jul 11, 2017): I'm also having linking issues building latest qB (https://github.com/qbittorrent/qBittorrent/issues/5608), but can't pinpoint where the issue is. Any help?
Author
Owner

@thalieht commented on GitHub (Jul 11, 2017):

What libtorrent version do you use?
This may help you #6721

@thalieht commented on GitHub (Jul 11, 2017): What libtorrent version do you use? This may help you #6721
Author
Owner

@WolfganP commented on GitHub (Jul 11, 2017):

I built libtorrent RC_1_0 (v1.0.11) and had no issues building qB v3.3.13, but couldn't built latest from master. Will try the suggestions on https://github.com/qbittorrent/qBittorrent/issues/6721.
Thanks!

@WolfganP commented on GitHub (Jul 11, 2017): I built libtorrent RC_1_0 (v1.0.11) and had no issues building qB v3.3.13, but couldn't built latest from master. Will try the suggestions on https://github.com/qbittorrent/qBittorrent/issues/6721. Thanks!
Author
Owner

@WaterSibilantFalling commented on GitHub (Jul 11, 2017):

@thalieht

I am building version 3.4.0 of qBittorrnet and version 1.2.0 of libtorrent. Are those compatible?

No. qbittorrent 3.4.0 and libtorrent 1.1.4 are.

Thanks for that. (I had thought that I had previously got qBt 3.4 to build with libtorrent 1.2, but I mis-remembered. 3.4.0 and .1.1.4 is the answer for me. Cheers.

@WaterSibilantFalling commented on GitHub (Jul 11, 2017): @thalieht >> I am building version 3.4.0 of qBittorrnet and version 1.2.0 of libtorrent. Are those compatible? > No. qbittorrent 3.4.0 and libtorrent 1.1.4 are. Thanks for that. (I had thought that I had previously got qBt 3.4 to build with libtorrent 1.2, but I mis-remembered. 3.4.0 and .1.1.4 is the answer for me. Cheers.
Author
Owner

@WolfganP commented on GitHub (Jul 19, 2017):

Thx to previous comments and help, I was able to build qbittorrent-nox succesfully this past weeks. I wanted to update master today and a new linking error appeared:

[...]
linking qbittorrent-nox
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:487: recipe for target 'qbittorrent-nox' failed
make[1]: *** [qbittorrent-nox] Error 1
make[1]: Leaving directory '/mnt/usb_22/xTransfer/qBittorrent/src'
Makefile:42: recipe for target 'sub-src-make_first' failed
make: *** [sub-src-make_first] Error 2

I couldn't find any commit from last week triggering the error. Do I need to add any flag?

edit: [SOLVED] somehow a dev package was missing that didn't trigger any error last week. Solved by: sudo apt-get install libz-dev

@WolfganP commented on GitHub (Jul 19, 2017): Thx to previous comments and help, I was able to build qbittorrent-nox succesfully this past weeks. I wanted to update master today and a new linking error appeared: ``` [...] linking qbittorrent-nox /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status Makefile:487: recipe for target 'qbittorrent-nox' failed make[1]: *** [qbittorrent-nox] Error 1 make[1]: Leaving directory '/mnt/usb_22/xTransfer/qBittorrent/src' Makefile:42: recipe for target 'sub-src-make_first' failed make: *** [sub-src-make_first] Error 2 ``` I couldn't find any commit from last week triggering the error. Do I need to add any flag? edit: [SOLVED] somehow a dev package was missing that didn't trigger any error last week. Solved by: sudo apt-get install libz-dev
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#5768
No description provided.