qbittorrent / qBittorrent

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

qbittorrent 3.4.0.r7075.e10c2ab as of 20161101 cannot compile - session.cpp #5888

Closed niko-yanev closed 8 years ago

niko-yanev commented 8 years ago
compiling base/bittorrent/session.cpp
base/bittorrent/session.cpp: In constructor ‘BitTorrent::Session::Session(QObject*)’:
base/bittorrent/session.cpp:206:1: warning: ‘BitTorrent::Session::m_wasTrackerExchangeEnabled’ is initialized with itself [-Winit-self]
 Session::Session(QObject *parent)
 ^~~~~~~
base/bittorrent/session.cpp:337:26: error: ‘generate_fingerprint’ is not a member of ‘libt’
     std::string peerId = libt::generate_fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
                          ^~~~
base/bittorrent/session.cpp:369:47: warning: ‘boost::shared_ptr<libtorrent::torrent_plugin> libtorrent::create_lt_trackers_plugin(const libtorrent::torrent_handle&, void*)’ is deprecated [-Wdeprecated-declarations]
         m_nativeSession->add_extension(&libt::create_lt_trackers_plugin);
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from base/bittorrent/session.cpp:58:0:
/usr/include/libtorrent/extensions/lt_trackers.hpp:56:51: note: declared here
  boost::shared_ptr<torrent_plugin> TORRENT_EXPORT create_lt_trackers_plugin(torrent_handle const&, void*);
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
base/bittorrent/session.cpp: In member function ‘BitTorrent::SessionStatus BitTorrent::Session::status() const’:
base/bittorrent/session.cpp:3025:36: warning: ‘libtorrent::session_status libtorrent::session_handle::status() const’ is deprecated [-Wdeprecated-declarations]
     return m_nativeSession->status();
                                    ^
In file included from /usr/include/libtorrent/session.hpp:53:0,
                 from base/bittorrent/session.cpp:67:
/usr/include/libtorrent/session_handle.hpp:284:18: note: declared here
   session_status status() const;
                  ^~~~~~
base/bittorrent/session.cpp: In member function ‘BitTorrent::CacheStatus BitTorrent::Session::cacheStatus() const’:
base/bittorrent/session.cpp:3030:46: warning: ‘libtorrent::cache_status libtorrent::session_handle::get_cache_status() const’ is deprecated [-Wdeprecated-declarations]
     return m_nativeSession->get_cache_status();
                                              ^
In file included from /usr/include/libtorrent/session.hpp:53:0,
                 from base/bittorrent/session.cpp:67:
/usr/include/libtorrent/session_handle.hpp:297:16: note: declared here
   cache_status get_cache_status() const;
                ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:2984: session.o] Error 1
make[1]: Leaving directory '/home/gericom/PPA/Arch/qbittorrent/src/qBittorrent/src'
make: *** [Makefile:43: sub-src-make_first] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Here is the total output: distro manjaro with all the latest updates installed

makepkg
==> Making package: qbittorrent 3.4.0.20161101.r7075.e10c2ab-1 (Tue Nov  1 20:17:37 EET 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating qBittorrent git repo...
Fetching origin
  -> Found qbittorrent.install
  -> Found get_version.pri
==> Validating source files with sha512sums...
    qBittorrent ... Skipped
    qbittorrent.install ... Skipped
    get_version.pri ... Skipped
==> Extracting sources...
  -> Creating working copy of qBittorrent git repo...
Switched to a new branch 'makepkg'
==> Starting prepare()...
==> Starting pkgver()...
==> Starting build()...
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 whether gcc understands -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 for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... none
checking dependency style of g++... none
checking whether OS is FreeBSD... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.23... yes
checking whether to enable the Debug build... no
checking whether to enable the GUI... yes
checking whether to install the systemd service file... no
checking whether to enable the WebUI... yes
checking whether Qt4 should be enabled... no
checking for /usr/bin/qmake... yes
checking for Qt5 qmake >= 5.2.0... /usr/bin/qmake
checking whether QtDBus should be enabled... yes
checking for Qt5DBus >= 5.2.0... found
checking for boostlib >= 1.35... yes
configure: Boost CPPFLGAS: -I/usr/include
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
configure: Boost.System LIB: -lboost_system
checking which qtsingleapplication to use... shipped
checking for libtorrent... yes
checking for zlib... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating conf.pri
config.status: executing depfiles commands
configure: Running qmake to generate the makefile...
Project MESSAGE: Building translations
Project MESSAGE: Processing lang/qbittorrent_ar
Project MESSAGE: Processing lang/qbittorrent_be
Project MESSAGE: Processing lang/qbittorrent_bg
Project MESSAGE: Processing lang/qbittorrent_ca
Project MESSAGE: Processing lang/qbittorrent_cs
Project MESSAGE: Processing lang/qbittorrent_da
Project MESSAGE: Processing lang/qbittorrent_de
Project MESSAGE: Processing lang/qbittorrent_el
Project MESSAGE: Processing lang/qbittorrent_en
Project MESSAGE: Processing lang/qbittorrent_en_AU
Project MESSAGE: Processing lang/qbittorrent_en_GB
Project MESSAGE: Processing lang/qbittorrent_eo
Project MESSAGE: Processing lang/qbittorrent_es
Project MESSAGE: Processing lang/qbittorrent_eu
Project MESSAGE: Processing lang/qbittorrent_fi
Project MESSAGE: Processing lang/qbittorrent_fr
Project MESSAGE: Processing lang/qbittorrent_gl
Project MESSAGE: Processing lang/qbittorrent_he
Project MESSAGE: Processing lang/qbittorrent_hi_IN
Project MESSAGE: Processing lang/qbittorrent_hr
Project MESSAGE: Processing lang/qbittorrent_hu
Project MESSAGE: Processing lang/qbittorrent_hy
Project MESSAGE: Processing lang/qbittorrent_id
Project MESSAGE: Processing lang/qbittorrent_it
Project MESSAGE: Processing lang/qbittorrent_ja
Project MESSAGE: Processing lang/qbittorrent_ka
Project MESSAGE: Processing lang/qbittorrent_ko
Project MESSAGE: Processing lang/qbittorrent_lt
Project MESSAGE: Processing lang/qbittorrent_nb
Project MESSAGE: Processing lang/qbittorrent_nl
Project MESSAGE: Processing lang/qbittorrent_pl
Project MESSAGE: Processing lang/qbittorrent_pt_BR
Project MESSAGE: Processing lang/qbittorrent_pt_PT
Project MESSAGE: Processing lang/qbittorrent_ro
Project MESSAGE: Processing lang/qbittorrent_ru
Project MESSAGE: Processing lang/qbittorrent_sk
Project MESSAGE: Processing lang/qbittorrent_sl
Project MESSAGE: Processing lang/qbittorrent_sr
Project MESSAGE: Processing lang/qbittorrent_sv
Project MESSAGE: Processing lang/qbittorrent_tr
Project MESSAGE: Processing lang/qbittorrent_uk
Project MESSAGE: Processing lang/qbittorrent_vi
Project MESSAGE: Processing lang/qbittorrent_zh
Project MESSAGE: Processing lang/qbittorrent_zh_HK
Project MESSAGE: Processing lang/qbittorrent_zh_TW
Reading /home/gericom/PPA/Arch/qbittorrent/src/qBittorrent/src/src.pro
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.

configure: Good, your configure finished.

cd src/ && ( test -e Makefile || /usr/bin/qmake /home/gericom/PPA/Arch/qbittorrent/src/qBittorrent/src/src.pro QMAKE_LRELEASE= -o Makefile ) && make -f Makefile 
make[1]: Entering directory '/home/gericom/PPA/Arch/qbittorrent/src/qBittorrent/src'
uic gui/properties/propertieswidget.ui
uic gui/properties/trackersadditiondlg.ui
uic gui/properties/peersadditiondlg.ui
uic gui/rss/rss.ui
uic gui/rss/rsssettingsdlg.ui
uic gui/rss/automatedrssdownloader.ui
uic gui/mainwindow.ui
uic gui/about.ui
uic gui/preview.ui
uic gui/login.ui
uic gui/downloadfromurldlg.ui
uic gui/bandwidth_limit.ui
uic gui/updownratiodlg.ui
uic gui/confirmdeletiondlg.ui
uic gui/shutdownconfirmdlg.ui
uic gui/executionlog.ui
uic gui/addnewtorrentdialog.ui
uic gui/autoexpandabledialog.ui
uic gui/statsdialog.ui
uic gui/optionsdlg.ui
uic gui/torrentcreatordlg.ui
uic gui/search/searchwidget.ui
uic gui/search/pluginselectdlg.ui
uic gui/search/pluginsourcedlg.ui
uic gui/search/searchtab.ui
uic gui/cookiesdialog.ui
compiling app/qtsingleapplication/qtsingleapplication.cpp
compiling app/qtsingleapplication/qtlocalpeer.cpp
compiling app/application.cpp
compiling app/filelogger.cpp
compiling app/main.cpp
app/main.cpp: In function ‘void sigNormalHandler(int)’:
app/main.cpp:332:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, str1, strlen(str1));
                                             ^
app/main.cpp:333:51: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, sigName, strlen(sigName));
                                                   ^
app/main.cpp:334:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, str2, strlen(str2));
                                             ^
app/main.cpp: In function ‘void sigAbnormalHandler(int)’:
app/main.cpp:347:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, str1, strlen(str1));
                                             ^
app/main.cpp:348:51: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, sigName, strlen(sigName));
                                                   ^
app/main.cpp:349:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     write(STDERR_FILENO, str2, strlen(str2));
                                             ^
compiling base/tristatebool.cpp
compiling base/filesystemwatcher.cpp
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
compiling base/bittorrent/session.cpp
base/bittorrent/session.cpp: In constructor ‘BitTorrent::Session::Session(QObject*)’:
base/bittorrent/session.cpp:206:1: warning: ‘BitTorrent::Session::m_wasTrackerExchangeEnabled’ is initialized with itself [-Winit-self]
 Session::Session(QObject *parent)
 ^~~~~~~
base/bittorrent/session.cpp:337:26: error: ‘generate_fingerprint’ is not a member of ‘libt’
     std::string peerId = libt::generate_fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
                          ^~~~
base/bittorrent/session.cpp:369:47: warning: ‘boost::shared_ptr<libtorrent::torrent_plugin> libtorrent::create_lt_trackers_plugin(const libtorrent::torrent_handle&, void*)’ is deprecated [-Wdeprecated-declarations]
         m_nativeSession->add_extension(&libt::create_lt_trackers_plugin);
                                               ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from base/bittorrent/session.cpp:58:0:
/usr/include/libtorrent/extensions/lt_trackers.hpp:56:51: note: declared here
  boost::shared_ptr<torrent_plugin> TORRENT_EXPORT create_lt_trackers_plugin(torrent_handle const&, void*);
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
base/bittorrent/session.cpp: In member function ‘BitTorrent::SessionStatus BitTorrent::Session::status() const’:
base/bittorrent/session.cpp:3025:36: warning: ‘libtorrent::session_status libtorrent::session_handle::status() const’ is deprecated [-Wdeprecated-declarations]
     return m_nativeSession->status();
                                    ^
In file included from /usr/include/libtorrent/session.hpp:53:0,
                 from base/bittorrent/session.cpp:67:
/usr/include/libtorrent/session_handle.hpp:284:18: note: declared here
   session_status status() const;
                  ^~~~~~
base/bittorrent/session.cpp: In member function ‘BitTorrent::CacheStatus BitTorrent::Session::cacheStatus() const’:
base/bittorrent/session.cpp:3030:46: warning: ‘libtorrent::cache_status libtorrent::session_handle::get_cache_status() const’ is deprecated [-Wdeprecated-declarations]
     return m_nativeSession->get_cache_status();
                                              ^
In file included from /usr/include/libtorrent/session.hpp:53:0,
                 from base/bittorrent/session.cpp:67:
/usr/include/libtorrent/session_handle.hpp:297:16: note: declared here
   cache_status get_cache_status() const;
                ^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:2984: session.o] Error 1
make[1]: Leaving directory '/home/gericom/PPA/Arch/qbittorrent/src/qBittorrent/src'
make: *** [Makefile:43: sub-src-make_first] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
sledgehammer999 commented 8 years ago

That is let's say intended. Keep in mind that libtorrent 1.1.x series aren't officially supported. And we're finding libtorrent bugs along the transition.

Your build because we use a libtorrent function that was introduced very recently in their RC_1_1 branch. So you can compile with one of these instead:

  1. Libtorrent 1.0.x series (officially supported)
  2. Latest code from RC_1_1 branch
  3. Wait for libtorrent 1.1.2 release.

Btw, thanks for reporting, I fixed the warning your output showed which would result in a bug.

WaterSibilantFalling commented 7 years ago

I just tried to compile 3.3.9 against libtorrent 1.1.1 and got this exactly the same message. I followed the instructions, including cloning from git and setting RC_1_1, so the error is still present.

I will try again with RC_1_0 and see what happens.

WaterSibilantFalling commented 7 years ago

same inabiity to link, with the same messages, when trying to build qbittorrent 3.3.9 with the RC_1_0 branch of libtorrent

 t > make && make install
` cd src/ && ( test -e Makefile || /usr/lib/i386-linux-gnu/qt5/bin/qmake /.hw/home/be nch/system/toInstall/torrenting/qbittorrent-3.3.9/src/src.pro QMAKE_LRELEASE= -o Ma kefile ) && make -f Makefile
 make[1]: Entering directory '/.hw/home/bench/system/toInstall/torrenting/qbittorren t-3.3.9/src'
 linking qbittorrent
 session.o: In function `BitTorrent::Session::adjustLimits()':
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:862: undefined reference to `libtorrent::session::settings() const'
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:864: undefined reference to `libtorrent::session::set_settings(libtorrent::s ession_settings const&)'
 session.o: In function `BitTorrent::Session::configure(libtorrent::session_settings &)':
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:1130: undefined reference to `libtorrent::session::set_pe_settings(libtorren t::pe_settings const&)'
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:1231: undefined reference to `libtorrent::session::add_dht_router(std::pair< std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, in t> const&)'
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:1232: undefined reference to `libtorrent::session::add_dht_router(std::pair< std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, in t> const&)'
 /home/bench/system/toInstall/torrenting/qbittorrent-3.3.9/src/base/bittorrent/sessi on.cpp:1233: undefined reference to `libtorrent::session::add_dht_router(std::pair< std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, in t> const&)'

So I am kinda stuck:

sledgehammer999 commented 7 years ago

When you build latest RC_1_1 or RC_1_0 branch or build any of 1.0.x tarballs then when configuring qbt you need to point pkg-config to your custom installation of libtorrent. Not the system one. I suppose qbt still picks up the system's libtorrent.

pmo-19 commented 7 years ago

I don't agree with your statement of whether a system or system intall of libtorrent is used. The Launchpad PPA https://launchpad.net/~qbittorrent-team/+archive/ubuntu/qbittorrent-stable/+packages fails to build as well for Yakkety 16.10 with this error and it's obviously using the libtorrent library build inside the PPA which is version 1.0.10. [NOTE: It is not using it] Looking at your C++ code in src/base/bittorrent/session.cpp , depending on the version of the libtorrent library the processing differs. For version < 1.0.10 (which is Not the case in the PPA) you invoke libt::fingerprint fingerprint (... For more recent version (which is the case in the PPA for Yakkety 16.10) you invoke std::string peerId = libt::generate_fingerprint (... It looks like it fails only with the latest release of Ubuntu : Yakkety 16.10.

Well after double checking for the official release package in Yakkety 16.10 I found that they have libtorrent version 1.1.0 as the system build. So this library (more recent) than the one used in the PPA 1.0.10 is used (in that sense you were right), and this cause the failure.

Anyway you need to update your code to make it compliant with the latest versions of libtorrent which are available on GitHub https://github.com/arvidn/libtorrent/releases

WaterSibilantFalling commented 7 years ago

So, as far as compiling the latest qBittorrent, I should (?) wait until the code update you just mentioned [https://github.com/qbittorrent/qBittorrent/issues/5888#issuecomment-269909397] is applied?

[After another go I got the apt(itude) packaged qBittorent 3.3.7 to install. I would like to build and run the latest version if I could, though. ]