help compiling qbittorrent with vc 10 [libtorrentd.lib]

Windows specific questions, problems.
Post Reply
dyeray

help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by dyeray »

Hi,

I've been trying to compile qbittorrent for windows following this tutorial https://github.com/qbittorrent/qBittorr ... linkage%29

I compile libtorrent 0.16.12 with the command shown there but I can't get a file called libtorrentd.lib:

Code: Select all

bjam -q --without-python --toolset=msvc variant=release link=static runtime-link=shared logging=none geoip=static dht-support=on boost=source define="BOOST_FILESYSTEM_VERSION=2" encryption=openssl
I get a file called libtorrent.lib that if changed in name to libtorrentd.lib can't be linked. I can't find information on the internet about libtorrentd.lib
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by sledgehammer_999 »

Are you building a debug version? If not, then you only need libtorrent.lib. If you are sure that you want a debug build of libtorrent(==libtorrentd.lib) then do:

Code: Select all

bjam -q --without-python --toolset=msvc variant=debug link=static runtime-link=shared logging=none geoip=static dht-support=on boost=source define="BOOST_FILESYSTEM_VERSION=2" encryption=openssl
dyeray

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by dyeray »

Oh, thanks I see. I want to compile it for debugging, but just qbittorrent, so the libraries it uses I've compiled without debugging symbols. Now I see that on winconf-msvc.pri it looks for the debugging version of boost and libtorrent when compiling for debugging. For now I've successfully compiled it in the release mode, I will try later the debug mode.

By the way, there are things that could be cleared or updated in the tutorial. Of course I don't know if some things didn't work just for my case. For example.:

-As the tutorial is for MSVC 10, the compiler could be defined as --toolset=msvc-10.0, I had vs2012 installed as well and it compiles it by default with that version.
-I don't know why but the tutorial doesn't make any reference to zlib, in my case the compilation was not trivial, I had to download also cmake.
-I downloaded the version of bjam and boost linked in the article and they appear to be incompatible, but the boost libraries themselves have the source code of bjam, so going to the subdirectory of bjam and compiling it generates the corresponding bjam to then compile the libraries and libtorrent.

I am not complaining, I just want to make the tutorial better if it is the case that they have errors.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by sledgehammer_999 »

See here: https://github.com/qbittorrent/qBittorr ... ompilation

The link you provided was used by the old windows packager. He stopped packaging qbt over a year ago. The current official build is done with the first method, which was written by me. I kept the old method around for historic purposes. The third method is written by Dayman who makes the x64 bit builds and I think is also up-to-date. My method should work with msvc2010 too(replace msvc-9.0 with msvc-10.0 in bjam), but making a static debug build will result in a huge binary probably.
dyeray

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by dyeray »

Ok, thanks, I had seen that tutorial, but I didn't know the other one was out of date, and as the static one required random tools like perl and nasm I tried the dynamic.

Out of curiosity, is there any reason why the official build of qbittorrent is linked statically -besides having just one file-?
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by sledgehammer_999 »

If you want to distribute it do other PCs you have to bundle correctly the msvc2008 runtimes**. Which isn't as easy because of the WinSxS stuff and the only sure way was to include the vc-redist from MS. Well that, bloated the size of the installer very much. Also the static build strips away all of the unused code of the libs. Qt is big. If you include the .dlls for qt+libtorrent I think the total file size is bigger than the static build.

Besides it's easier to distribute one binary(well you have to package the qt translations too)

Perl is used for the OpenSSL compilation. I compile it myself from source. Nasm is used for zlib and OpenSSL and probaly qt uses it too. nasm outputs compiles assembly code for those libs, which is highly optimized by hand. Otherwise the libs will use the C code path which probably isn't as fast as the assembly code path.

**About the msvc2008 runtimes. This is problem if the user has Win XP. IIRC Vista+ include those runtimes by default so no need to distribute them.
Rogue_Spider

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by Rogue_Spider »

i also have been trying to get 32bit dynamic i would be interested in step by step what you changed and commands used - i keep ending in unknown error in exe
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by sledgehammer_999 »

[quote="Rogue_Spider"]
i also have been trying to get 32bit dynamic i would be interested in step by step what you changed and commands used - i keep ending in unknown error in exe
[/quote]

What error? When compiling which component?(qt,libtorrent, openssl)
Rogue_Spider

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by Rogue_Spider »

http://qbforums.shiki.hu/index.php/topic,2235.0.html

I tried to use wiki build instructions but there very unclear and incomplete

all said and done with alot of work im in qt creator and i end up with 2189 warnings about libtorrent storage and

install\libtorrent\include\libtorrent\storage.hpp:277: warning: C4100: 'slot' : unreferenced formal parameter

stuff like that and

qbittorrent.exe exited with code -1073741515

a step by step would be nice
dyeray

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by dyeray »

I get also the warnings, I think there isn't a problem with that. I think your problem is you need to point in winconfig.pri to the folder where zlib.dll is, like this:

LIBS += $$quote(-LC:\zlib_path)

I think, but I am not sure, the zlib.dll needs to be compiled for vc10 also. I got zlib 1.2.8 source, created the vs 2010 files using cmake ( cmake comes with a nice gui for doing so, just be sure you install the visual studio 2010 service pack before doing it). After that just open the solution on vs and compile the project called zlib. That should get you the dll. Good luck!
Dayman

Re: help compiling qbittorrent with vc 10 [libtorrentd.lib]

Post by Dayman »

[quote="Rogue_Spider"]
qbittorrent.exe exited with code -1073741515
[/quote]

So you did build it, but it doesn't launch. The most likely cause is that you don't have necessary libraries in %PATH% variable, that is if you want to start directly from Qt Creator. If not you should copy resulting exe along with necessary Qt/libtorrent/Boost/OpenSSL libraries into somewhere.
Post Reply