qBittorrent
qBittorrent copied to clipboard
Release 5.0 Beta 1 compiling error
qBittorrent & operating system versions
Trying to compile qBittorrent 5.0 beta 1 in windows with CMake but with VS 2022 like I have prior releases. I get thru everything until I do a
cmake --build build
Gets thru everything then errors out linking. Seems like conflicting values perhaps in different parts of the code?
What is the problem?
C:\qbittorrent\qBittorrent-release-5.0.0beta1>cmake --build build [1/1] Linking CXX executable qbittorrent.exe FAILED: qbittorrent.exe C:\Windows\system32\cmd.exe /C "cd . && C:\qbittorrent\cmake\bin\cmake.exe -E vs_link_exe --intdir=src\app\CMakeFiles\qbt_app.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests C:\qbittorrent\qBittorrent-release-5.0.0beta1\src\qbittorrent.exe.manifest -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\qbt_app.rsp /out:qbittorrent.exe /implib:src\app\qbittorrent.lib /pdb:qbittorrent.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:windows /DEBUG /PDBALTPATH:qbittorrent.pdb /guard:cf /OPT:REF /OPT:ICF && C:\Windows\system32\cmd.exe /C "cd /D C:\qbittorrent\qBittorrent-release-5.0.0beta1\build\src\app && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file C:/qbittorrent/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/qbittorrent/qBittorrent-release-5.0.0beta1/build/qbittorrent.exe -installedDir C:/qbittorrent/vcpkg/installed/x64-windows-static/bin -OutVariable out"" LINK: command "C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\qbt_app.rsp /out:qbittorrent.exe /implib:src\app\qbittorrent.lib /pdb:qbittorrent.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:windows /DEBUG /PDBALTPATH:qbittorrent.pdb /guard:cf /OPT:REF /OPT:ICF /MANIFEST:EMBED,ID=1 /MANIFESTINPUT:C:\qbittorrent\qBittorrent-release-5.0.0beta1\src\qbittorrent.exe.manifest" failed (exit code 1169) with the following output: qwindows.lib(qwindowsintegration.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) qwindows.lib(qwindowscontext.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) qwindows.lib(qwindowstheme.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) qnetworklistmanager.lib(qnetworklistmanagernetworkinformationbackend.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) qnetworklistmanager.lib(qnetworklistmanagerevents.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) qnetworklistmanager.lib(mocs_compilation.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) Qt6Core.lib(removed_api.cpp.obj) : error LNK2005: "public: __cdecl QLocale::QLocale(class QString const &)" (??0QLocale@@QEAA@AEBVQString@@@Z) already defined in qbt_gui.lib(optionsdialog.cpp.obj) Qt6Core.lib(removed_api.cpp.obj) : error LNK2005: "public: bool __cdecl QByteArray::isNull(void)const " (?isNull@QByteArray@@QEBA_NXZ) already defined in mocs_compilation.cpp.obj Qt6Core.lib(removed_api.cpp.obj) : error LNK2005: "public: void __cdecl QBasicTimer::start(int,class QObject *)" (?start@QBasicTimer@@QEAAXHPEAVQObject@@@Z) already defined in qbt_base.lib(rss_autodownloader.cpp.obj) Qt6Core.lib(removed_api.cpp.obj) : error LNK2005: "public: __int64 __cdecl QString::toLongLong(bool *,int)const " (?toLongLong@QString@@QEBA_JPEA_NH@Z) already defined in qbt_webui.lib(torrentscontroller.cpp.obj) Qt6Core.lib(qfactorycacheregistration.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) Qt6Core.lib(qlocale_win.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj) Creating library src\app\qbittorrent.lib and object src\app\qbittorrent.exp qbittorrent.exe : fatal error LNK1169: one or more multiply defined symbols found ninja: build stopped: subcommand failed.
Steps to reproduce
No response
Additional context
No response
Log(s) & preferences file(s)
No response
Maybe unclean build directory?
I just built it for the first time. Removed cmake, removed the vcpkg folder and obviously new install of this beta build. Then started from scratch. Not sure but guessing some conflict with Qt6 libraries and something? The conflicting values for example:
qwindows.lib(qwindowsintegration.cpp.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in qbt_base.lib(sessionimpl.cpp.obj)
Show that two libraries or what I see have different values for the same thing or something.
So maybe there are different values of -std flag are used when building Qt and qBittorrent (or other its dependencies)?
Beyond my knowledge. I basically just followed the cmake steps on the Wiki to build it other than i had to change or add
.\vcpkg install qtbase:x64-windows-static qtsvg:x64-windows-static qttools:x64-windows-static
to the supported libraries since qBittorrent now uses qt6 vs qt5.
i had to change or add
.\vcpkg install qtbase:x64-windows-static qtsvg:x64-windows-static qttools:x64-windows-static
to the supported libraries since qBittorrent now uses qt6 vs qt5.
Did I understand correctly that you are trying to build the current qBittorrent with Qt5?
No. The current Wiki article says it's using Qt5. I modified the vcpkg line per above to use Qt6.
Note I just blew away the whole qbittorrent folder and did the following:
- Download the latest cmake also tried the one built into VS
- Put ninja in my path
- All the tools and features are installed with VS
- Opened the VS cmd prompt
- git clone https://github.com/microsoft/vcpkg
- cd .\vcpkg
- .\bootstrap-vcpkg.bat -disableMetrics
- .\vcpkg integrate install
- .\vcpkg install boost-circular-buffer:x64-windows-static boost-stacktrace:x64-windows-static openssl:x64-windows-static qtbase:x64-windows-static qtsvg:x64-windows-static qttools:x64-windows-static
- .\vcpkg install libtorrent:x64-windows-static
- Go into the C:\qbittorrent\qBittorrent-release-5.0.0beta1 folder
- cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="C:\qbittorrent\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="x64-windows-static" -DMSVC_RUNTIME_DYNAMIC=OFF
- cmake --build build
Get the above errors.
@jriker1 So why do you need to compile it yourself?
Probably not the right path to go down for the question unless you are eliminating manual compiling but I usually modify a few things to work with some custom scripts with Sonarr. Minor tweaks. Right now just trying to deal with compiling it at all.
Probably not the right path to go down for the question unless you are eliminating manual compiling
Manual compilation requires some competence, because no one will provide you with instructions that would work under any conditions. If you cannot check the assumptions about the cause of the compilation problem because it is "Beyond my knowledge", then only someone who compiles it himself under exactly the same conditions can help you to provide you with detailed instructions. I'm not using the wiki method, so I won't be able to help you with it.
Yeah, problem is conceptually very obvious. The libraries and code being used is mixing code that is using experimental coroutines with code that uses standard coroutines and they can't interoperate
Yeah, problem is conceptually very obvious. The libraries and code being used is mixing code that is using experimental coroutines with code that uses standard coroutines and they can't interoperate
Yes. That's why I assumed that different compilation flags are used for Qt and qBittorrent, namely a different version of the C++ standard. qBittorrent v5.0 requires C++20, so it is forced in the build configuration. Qt most likely uses C++17 (or earlier) by default.
Qt most likely uses C++17 (or earlier) by default.
As of Qt 6, (C++17 compatible compiler is now required) see: https://www.qt.io/blog/qt-6.0-released
C++20 is still opt-in, see: https://www.qt.io/blog/qt-6.7-released (Qt 6.7 also has better support for Windows 11 23H2/macOS 14 - Sonoma)
@jriker1 What changes are you trying to make in the code/why don't you use GitHub Actions?
(you can then also use/test Qt 6.7.1 etc.)
vcpkg have only just recently updated to Qt 6.6.3, there's a PR open for Qt 6.7.0
BTW, I don't see any mention in the wiki of zlib or in your comments & it may have no bearing on this issue either but just as an FYI for vcpkg it's zlib:x64-windows-static
Closing - No response from OP.