qbittorrent / qBittorrent

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

Compilation fails #8335

Closed Tikani closed 6 years ago

Tikani commented 6 years ago

qBittorrent version and Operating System

master branch, Debian 9 Stretch stable

If on linux, libtorrent and Qt version

libtorrent-rastebar9, libtorrent-rastebar-dev 1.1.1-1 from the official "stable" repo, Qt 5.10 of offline installation bundle from qt.io

What is the problem

Compilation fails with the errors:

  1. /home/tikani/GitHub/qBittorrent/src/base/bittorrent/session.cpp:420: ошибка: ‘generate_fingerprint’ is not a member of ‘libt’
  2. /home/tikani/GitHub/qBittorrent/src/base/bittorrent/session.cpp:150: ошибка: passing ‘const libtorrent::bdecode_node’ as ‘this’ argument discards qualifiers [-fpermissive] const QString tag = QString::fromStdString(entry.list_string_value_at(i));

What is the expected behavior

Successful compilation

Steps to reproduce

  1. Install all dependencies listed in wiki
  2. Try to compile using either QMake or CMake in QtCreator

Extra info(if any)

ClangCodeModel plugin is enabled in QtCreator, so I get detailed descriptions of errors, but I can't copy-paste it here since a pop-up with error explanation disappears on selection or pressing Ctrl+C. But I can retype them here by hand, if needed.

thalieht commented 6 years ago

You need libtorrent >=1.1.2 for the 1.1.x branch.

Tikani commented 6 years ago

Thanks a lot, I've installed 1.1.5 version from "testing" which resolved the last error, but on the following compilation I've got: compiling moc_webui.cpp linking qbittorrent /usr/bin/ld: gzip.o: undefined reference to symbol 'inflateInit2_' Makefile:1018: recipe for target 'qbittorrent' failed make[1]: Leaving directory '/home/tikani/GitHub/build-qbittorrent-Desktop_Qt_5_10_0_GCC_64bit-Debug/src' Makefile:44: recipe for target 'sub-src-make_first' failed //lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[1]: *** [qbittorrent] Error 1 make: *** [sub-src-make_first] Error 2

sledgehammer999 commented 6 years ago

The official way is to use configure to configure the project. Cmake isn't guaranteed to always work. So start with a clean directory and do ./configure in it. Then open qbittorrent.pro from QtCreator and start hacking. If you only want to build it, you don't need QtCreator. Just issue make after ./configure.

Does that fix your problem?

FranciscoPombal commented 6 years ago

@sledgehammer999

The official way is to use configure to configure the project. Cmake isn't guaranteed to always work. So start with a clean directory and do ./configure in it. Then open qbittorrent.pro from QtCreator and start hacking.

Thanks for this, the other day I wanted to play a bit with the code and I was struggling to setup QtCreator for the project.

Can you please provide further details on your workflow/toolchain? Ideally there should also be a wiki entry about it. There are already a lot of articles about compiling on Windows/Linux but no articles that detail a standard development environment for qBittorrent on Linux with QtCreator or on Windows.