Closed hwhsu1231 closed 2 years ago
The reason why I add qt:with_glib=True
option in conan_cmake_configure()
is because after I run windeployqt
and execute the executable, the system pop up the error message:
The program can't start because glib-2.0-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
Therefore, I try to add qt:with_glib=True
option in it. However, another error shows up, which is the title of this issue.
cmake_find_package_multi-qt.zip
Thanks for the report. the issue about the missing dll should have been solved with https://github.com/conan-io/conan-center-index/pull/9782. Could you please remove ~/.conan/data/qt/6.2.1/_/_/package
and retry so that it re-downloads an up to date binary ?
@ericLemanissier, I followed what you said, removing the %UserProfile%/.conan/data/qt/6.2.1/_/_/package
and reinstalling the qt/6.2.1. However, the missing-dll error still popped up for Debug version only. (without specifying qt:with_glib=True
option)
mmmm, you probably need to remove %UserProfile%/.conan/data/qt/6.2.1
completely.
Alternatively, you could use the UPDATE
argument of conan_cmake_install
in order to update your local cache
@ericLemanissier, I followed what you said. However, after deleting the whole directory of %UserProfile%/.conan/data/qt
and then reconfiguring the CMakeLists.txt
, (without specifying qt:with_glib=True
option)
[cmake] FAILED: qtbase/res/archdatadir/plugins/sqldrivers/qsqlpsql.dll
[cmake] cmd.exe /C "cd . && C:\.conan\7ccfac\1\bin\cmake.exe -E vs_link_dll --intdir=qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\QPSQLDriverPlugin_autogen\mocs_compilation.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\main.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\qsql_psql.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\QPSQLDriverPlugin_resource.rc.res /out:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.dll /implib:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.lib /pdb:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO -DYNAMICBASE -NXCOMPAT -OPT:REF -OPT:ICF -GUARD:CF -LIBPATH:C:\.conan\232d67\1\lib -LIBPATH:C:\.conan\fa288e\1\lib -LIBPATH:C:\.conan\59af91\1\lib -LIBPATH:C:\.conan\8037b9\1\lib -LIBPATH:C:\.conan\b7e44d\1\lib -LIBPATH:C:\.conan\8b2fbc\1\lib -LIBPATH:C:\.conan\f36d64\1\lib -LIBPATH:C:\.conan\62a086\1\lib -LIBPATH:C:\.conan\1ce993\1\lib -LIBPATH:C:\.conan\838d8c\1\lib -LIBPATH:C:\.conan\a7d898\1\lib -LIBPATH:C:\.conan\240412\1\lib -LIBPATH:C:\.conan\cdb575\1\lib -LIBPATH:C:\.conan\238f7e\1\lib -LIBPATH:C:\.conan\538847\1\lib -LIBPATH:C:\.conan\ea75da\1\lib -LIBPATH:C:\.conan\c5685e\1\lib -LIBPATH:C:\.conan\b2ef6a\1\lib C:\.conan\f36d64\1\lib\libpq.lib ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib wldap32.lib C:\.conan\f36d64\1\lib\libpgcommon.lib C:\.conan\f36d64\1\lib\libpgport.lib qtbase\lib\Qt6Sql.lib qtbase\lib\Qt6Core.lib mpr.lib userenv.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[cmake] LINK: command "C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\QPSQLDriverPlugin_autogen\mocs_compilation.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\main.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\qsql_psql.cpp.obj qtbase\src\plugins\sqldrivers\psql\CMakeFiles\QPSQLDriverPlugin.dir\QPSQLDriverPlugin_resource.rc.res /out:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.dll /implib:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.lib /pdb:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO -DYNAMICBASE -NXCOMPAT -OPT:REF -OPT:ICF -GUARD:CF -LIBPATH:C:\.conan\232d67\1\lib -LIBPATH:C:\.conan\fa288e\1\lib -LIBPATH:C:\.conan\59af91\1\lib -LIBPATH:C:\.conan\8037b9\1\lib -LIBPATH:C:\.conan\b7e44d\1\lib -LIBPATH:C:\.conan\8b2fbc\1\lib -LIBPATH:C:\.conan\f36d64\1\lib -LIBPATH:C:\.conan\62a086\1\lib -LIBPATH:C:\.conan\1ce993\1\lib -LIBPATH:C:\.conan\838d8c\1\lib -LIBPATH:C:\.conan\a7d898\1\lib -LIBPATH:C:\.conan\240412\1\lib -LIBPATH:C:\.conan\cdb575\1\lib -LIBPATH:C:\.conan\238f7e\1\lib -LIBPATH:C:\.conan\538847\1\lib -LIBPATH:C:\.conan\ea75da\1\lib -LIBPATH:C:\.conan\c5685e\1\lib -LIBPATH:C:\.conan\b2ef6a\1\lib C:\.conan\f36d64\1\lib\libpq.lib ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib wldap32.lib C:\.conan\f36d64\1\lib\libpgcommon.lib C:\.conan\f36d64\1\lib\libpgport.lib qtbase\lib\Qt6Sql.lib qtbase\lib\Qt6Core.lib mpr.lib userenv.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:qtbase\res\archdatadir\plugins\sqldrivers\qsqlpsql.dll.manifest" failed (exit code 0) with the following output:
[cmake]
[cmake] LINK : fatal error LNK1000: Internal error during LIB::Search
[cmake] Access violation[676/2033] Building CXX object qtbase\src\testlib\CMakeFiles\Test.dir\qjunittestlogger.cpp.obj
[cmake] [677/2033] Building CXX object qtbase\src\testlib\CMakeFiles\Test.dir\qtestelementattribute.cpp.obj
[cmake] [678/2033] Building CXX object qtbase\src\testlib\CMakeFiles\Test.dir\qtestelement.cpp.obj
[cmake] [679/2033] Building CXX object qtbase\src\testlib\CMakeFiles\Test.dir\qplaintestlogger.cpp.obj
[cmake] [680/2033] Building CXX object qtbase\src\plugins\sqldrivers\sqlite\CMakeFiles\QSQLiteDriverPlugin.dir\qsql_sqlite.cpp.obj
[cmake] [681/2033] Automatic MOC for target Gui
[cmake] [682/2033] Building CXX object qtbase\src\plugins\networkinformation\networklistmanager\CMakeFiles\QNLMNIPlugin.dir\qnetworklistmanagernetworkinformationbackend.cpp.obj
[cmake]
[cmake] ninja: build stopped: subcommand failed.
[cmake] qt/6.2.1:
[cmake] WARN: replace_in_file didn't find pattern '$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:-Wl,--export-dynamic>' in 'Findstrawberryperl.cmake' file.
[cmake] WARN: replace_in_file didn't find pattern '$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:-Wl,--export-dynamic>' in 'Findstrawberryperl.cmake' file.
[cmake] WARN: replace_in_file didn't find pattern ' IMPORTED)
[cmake] ' in 'Findstrawberryperl.cmake' file.
[cmake] WARN: replace_in_file didn't find pattern '$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:-Wl,--export-dynamic>' in 'FindZLIB.cmake' file.
[cmake] WARN: replace_in_file didn't find pattern '$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:-Wl,--export-dynamic>' in 'FindZLIB.cmake' file.
[cmake] WARN: replace_in_file didn't find pattern ' IMPORTED)
[cmake] ' in 'FindZLIB.cmake' file.
[cmake] qt/6.2.1: ERROR: Package 'ce45aa10b3c7a7af5d091d0f7398bab2839bda02' build failed
[cmake] qt/6.2.1: WARN: Build folder C:\.conan\7f82577\1
[cmake] ERROR: qt/6.2.1: Error in build() method, line 705
[cmake] cmake.build()
[cmake] ConanException: Error 1 while executing cmake --build C:\.conan\7f82577\1 -- -j8
[cmake] CMake Error at build/win32-MSVC-x64-Release/conan.cmake:638 (message):
[cmake] Conan install failed='1'
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:55 (conan_cmake_install)
according to https://developercommunity.visualstudio.com/t/link-fatal-error-lnk1000-internal-error-during-lib/346556 This could be a problem in your visual studio installation. This user uninstalled and reinstalled visual studio to fix it.
It works fine with Release version after I update the Visual Studio 2019. (without specifying qt:with_glib=True
option)
@ericLemanissier, may I ask you something about glib
?
Why did the missing-glib.dll error show up before? It seems that windeployqt
don't deploy the executable with glib-2.0-0.dll
in the bin
directory both before and after the modification. What did you do?
If we can run successfully without specifying qt:with_glib=True
option, what is the meaning or purpose of this option?
the trigger of this failure is this commit: https://github.com/conan-io/conan-center-index/commit/212b4c102e4f5b766a4f59d9565f4cf644b8d58d#diff-fdf18cd9e1a6791c362f442356c35a16d9ae296ede7454329f7766d60f182fd6R66. Before that, glib was always a dll on windows. so existing binaries of packages requiring glib had code to load the dll. After this commit, glib is static on windows, so conan does not download download the glib binary which has the dll, but the one with the static library. Hence you get a message at runtime that glib's dll could not be found. The simple fix to this kind of issues is to rebuild all binaries which depend on glib.
option with_glib adds some features to qt, which need glib. I don't really know more about it, but if you don't know how to choose an option for this value, then use False. Otherwise you need to check qt's documentation
I got it. Thanks.
However, I have another problem with this issue. I notice that there are some empty files generated in the workspace directory. They pop up "sometimes" not always when I configure the project. This situation didn't happen before. So I think it is related to this modification.
not related to conan or conan-center recipes:
Package and Environment Details (include every applicable attribute)
Conan profile (output of
conan profile show default
)I use CMake-Conan to install package. Here is my root-level
CMakeLists.txt
file:Steps to reproduce (Include if Applicable)
CMakeLists.txt
file, and then paste the above example on it.Ctrl+Shift+P
, and then typeCMake: Configure
.Logs (Include/Attach if Applicable)
Click to expand log
``` [main] Configuring folder: cmake_find_package_multi-qt [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:STRING=d:/cmake_find_package_multi-qt/install -Hd:/cmake_find_package_multi-qt -Bd:/cmake_find_package_multi-qt/build/win32-MSVC-x64 -G "Ninja Multi-Config" [cmake] Not searching for unused variables given on the command line. [cmake] -- The CXX compiler identification is MSVC 19.29.30133.0 [cmake] -- Detecting CXX compiler ABI info [cmake] -- Detecting CXX compiler ABI info - done [cmake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped [cmake] -- Detecting CXX compile features [cmake] -- Detecting CXX compile features - done [cmake] ========== cmake_find_package_multi-qt ========== [cmake] -- Downloading conan.cmake from https://github.com/conan-io/cmake-conan ... [cmake] -- Conan: Detected VS runtime: MDd [cmake] -- Conan: checking conan executable [cmake] -- Conan: Found program C:/Program Files/Conan/conan/conan.exe [cmake] -- Conan: Version found Conan version 1.45.0 [cmake] -- Conan executing: C:/Program Files/Conan/conan/conan.exe install . --remote conancenter --install-folder ./conan --build missing --settings arch=x86_64 --settings build_type=Debug --settings compiler=Visual Studio --settings compiler.version=16 --settings compiler.runtime=MDd [cmake] Configuration: [cmake] [settings] [cmake] arch=x86_64 [cmake] arch_build=x86_64 [cmake] build_type=Debug [cmake] compiler=Visual Studio [cmake] compiler.runtime=MDd [cmake] compiler.version=16 [cmake] os=Windows [cmake] os_build=Windows [cmake] [options] [cmake] [build_requires] [cmake] [env] [cmake] [cmake] conanfile.txt: Installing package [cmake] Requirements [cmake] brotli/1.0.9 from 'conancenter' - Cache [cmake] bzip2/1.0.8 from 'conancenter' - Cache [cmake] double-conversion/3.1.5 from 'conancenter' - Cache [cmake] freetype/2.10.4 from 'conancenter' - Cache [cmake] glib/2.69.2 from 'conancenter' - Cache [cmake] harfbuzz/2.8.0 from 'conancenter' - Cache [cmake] libelf/0.8.13 from 'conancenter' - Cache [cmake] libffi/3.4.2 from 'conancenter' - Cache [cmake] libgettext/0.21 from 'conancenter' - Cache [cmake] libiconv/1.16 from 'conancenter' - Cache [cmake] libpng/1.6.37 from 'conancenter' - Cache [cmake] libpq/13.2 from 'conancenter' - Cache [cmake] openssl/1.1.1l from 'conancenter' - Cache [cmake] pcre/8.45 from 'conancenter' - Cache [cmake] pcre2/10.37 from 'conancenter' - Cache [cmake] qt/6.2.1 from 'conancenter' - Cache [cmake] sqlite3/3.36.0 from 'conancenter' - Cache [cmake] zlib/1.2.11 from 'conancenter' - Cache [cmake] Packages [cmake] brotli/1.0.9:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] bzip2/1.0.8:589a23dff5fdb23a7fb851223eb766480ead0a9a - Cache [cmake] double-conversion/3.1.5:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] freetype/2.10.4:c69bad48274e7fc45c887cddc32aa0459f0a81e0 - Cache [cmake] glib/2.69.2:be40f18f378280528cd840322653e95f245f4bb7 - Cache [cmake] harfbuzz/2.8.0:b3e4e64caf5e5fb282fb6697dad12bd1f7d68ede - Cache [cmake] libelf/0.8.13:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] libffi/3.4.2:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] libgettext/0.21:e0c22822cdf05b624135e1696ae5cb784a23aeb3 - Cache [cmake] libiconv/1.16:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] libpng/1.6.37:8b1ef0ec9599374db4689199730c00a0d5f4de36 - Cache [cmake] libpq/13.2:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] openssl/1.1.1l:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] pcre/8.45:7a162084f5550c625a8950e9b1175d1474d2fbab - Cache [cmake] pcre2/10.37:d5bf9f9853f79bcb782c6a7ad39636782a3da0fd - Cache [cmake] qt/6.2.1:a0cdade610fdf1a8a9166c71aeee6d42000f668b - Cache [cmake] sqlite3/3.36.0:5e2ee2bbbf247701a335de1962053720f3cbabf1 - Cache [cmake] zlib/1.2.11:d057732059ea44a47760900cb5e4855d2bea8714 - Cache [cmake] [cmake] Installing (downloading, building) binaries... [cmake] brotli/1.0.9: Already installed! [cmake] bzip2/1.0.8: Already installed! [cmake] bzip2/1.0.8: Appending PATH environment variable: C:\.conan\a06b72\1\bin [cmake] double-conversion/3.1.5: Already installed! [cmake] libelf/0.8.13: Already installed! [cmake] libffi/3.4.2: Already installed! [cmake] libiconv/1.16: Already installed! [cmake] libiconv/1.16: Appending PATH environment var: C:\.conan\1c71d0\1\bin [cmake] libpq/13.2: Already installed! [cmake] openssl/1.1.1l: Already installed! [cmake] sqlite3/3.36.0: Already installed! [cmake] sqlite3/3.36.0: Appending PATH env var with : C:\.conan\090ca6\1\bin [cmake] zlib/1.2.11: Already installed! [cmake] libgettext/0.21: Already installed! [cmake] libpng/1.6.37: Already installed! [cmake] pcre/8.45: Already installed! [cmake] pcre/8.45: Appending PATH environment variable: C:\.conan\6cacfb\1\bin [cmake] pcre2/10.37: Already installed! [cmake] pcre2/10.37: Appending PATH environment variable: C:\.conan\b4f8e2\1\bin [cmake] freetype/2.10.4: Already installed! [cmake] glib/2.69.2: Already installed! [cmake] glib/2.69.2: Appending PATH env var with: C:\.conan\cad52d\1\bin [cmake] harfbuzz/2.8.0: Already installed! [cmake] qt/6.2.1: Already installed! [cmake] WARN: harfbuzz/2.8.0: requirement freetype/2.11.0 overridden by qt/6.2.1 to freetype/2.10.4 [cmake] WARN: harfbuzz/2.8.0: requirement glib/2.70.0 overridden by qt/6.2.1 to glib/2.69.2 [cmake] ERROR: [cmake] ConanException: qt/6.2.1 package_info(): Package require 'glib' not used in components requires [cmake] CMake Error at build/win32-MSVC-x64/conan.cmake:638 (message): [cmake] Conan install failed='1' [cmake] Call Stack (most recent call first): [cmake] CMakeLists.txt:46 (conan_cmake_install) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! ```