Unable to build qt6 using conan package manager and msvc in vscode
Unsolved
General and Desktop
-
I am trying run qt6 gui application using msvc and conan.
Project Structure
CMakeLists.txt /src/
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) # Turn on automatic invocation of the MOC, UIC & RCC set (CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(akash main.cpp mainwindow.ui mainwindow.cpp mainwindow.h ) target_link_libraries(akash PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(akash PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE OFF )
Errors
[main] Configuring project: Qt [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_TOOLCHAIN_FILE=D:/Qt/build/conan_toolchain.cmake -SD:/Qt -BD:/Qt/build -G "Visual Studio 17 2022" [cmake] -- Using Conan toolchain: D:/Qt/build/conan_toolchain.cmake [cmake] -- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143 [cmake] -- Conan toolchain: C++ Standard 20 with extensions OFF [cmake] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631. [cmake] -- Conan: Component target declared 'Qt6::Core' [cmake] -- Conan: Component target declared 'Qt6::Platform' [cmake] -- Conan: Component target declared 'Qt6::Gui' [cmake] -- Conan: Component target declared 'Qt6::QWindowsIntegrationPlugin' [cmake] -- Conan: Component target declared 'Qt6::QWindowsVistaStylePlugin' [cmake] -- Conan: Component target declared 'Qt6::QGifPlugin' [cmake] -- Conan: Component target declared 'Qt6::QIcoPlugin' [cmake] -- Conan: Component target declared 'Qt6::QSQLiteDriverPlugin' [cmake] -- Conan: Component target declared 'Qt6::QPSQLDriverPlugin' [cmake] -- Conan: Component target declared 'Qt6::Network' [cmake] -- Conan: Component target declared 'Qt6::Sql' [cmake] -- Conan: Component target declared 'Qt6::Test' [cmake] -- Conan: Component target declared 'Qt6::Widgets' [cmake] -- Conan: Component target declared 'Qt6::PrintSupport' [cmake] -- Conan: Component target declared 'Qt6::OpenGL' [cmake] -- Conan: Component target declared 'Qt6::OpenGLWidgets' [cmake] -- Conan: Component target declared 'Qt6::Concurrent' [cmake] -- Conan: Component target declared 'Qt6::Xml' [cmake] -- Conan: Component target declared 'Qt6::EntryPointImplementation' [cmake] -- Conan: Component target declared 'Qt6::EntryPointPrivate' [cmake] -- Conan: Target declared 'qt::qt' [cmake] -- Conan: Component target declared 'OpenSSL::Crypto' [cmake] -- Conan: Component target declared 'OpenSSL::SSL' [cmake] -- Conan: Target declared 'openssl::openssl' [cmake] -- Conan: Target declared 'ZLIB::ZLIB' [cmake] -- Conan: Including build module from 'C:/Conan/b/opensc17884406927c/p/lib/cmake/conan-official-openssl-variables.cmake' [cmake] -- Conan: Target declared 'double-conversion::double-conversion' [cmake] -- Conan: Target declared 'harfbuzz::harfbuzz' [cmake] -- Conan: Target declared 'Freetype::Freetype' [cmake] -- Conan: Target declared 'BZip2::BZip2' [cmake] -- Conan: Including build module from 'C:/Conan/b/bzip2016d5f5aa8e0a/p/lib/cmake/conan-official-bzip2-variables.cmake' [cmake] -- Conan: Target declared 'PNG::PNG' [cmake] -- Conan: Component target declared 'brotli::brotlicommon' [cmake] -- Conan: Component target declared 'brotli::brotlidec' [cmake] -- Conan: Component target declared 'brotli::brotlienc' [cmake] -- Conan: Target declared 'brotli::brotli' [cmake] -- Conan: Including build module from 'C:/Conan/b/freeteebda791272d5/p/lib/cmake/conan-official-freetype-variables.cmake' [cmake] -- Conan: Component target declared 'glib::glib-2.0' [cmake] -- Conan: Component target declared 'glib::gmodule-no-export-2.0' [cmake] -- Conan: Component target declared 'glib::gmodule-export-2.0' [cmake] -- Conan: Component target declared 'glib::gmodule-2.0' [cmake] -- Conan: Component target declared 'glib::gobject-2.0' [cmake] -- Conan: Component target declared 'glib::gthread-2.0' [cmake] -- Conan: Component target declared 'glib::gio-2.0' [cmake] -- Conan: Component target declared 'glib::gresource' [cmake] -- Conan: Component target declared 'glib::gio-windows-2.0' [cmake] -- Conan: Target declared 'glib::glib' [cmake] -- Conan: Target declared 'libffi::libffi' [cmake] -- Conan: Component target declared 'PCRE2::8BIT' [cmake] -- Conan: Component target declared 'PCRE2::POSIX' [cmake] -- Conan: Component target declared 'PCRE2::16BIT' [cmake] -- Conan: Component target declared 'PCRE2::32BIT' [cmake] -- Conan: Target declared 'pcre2::pcre2' [cmake] -- Conan: Target declared 'Intl::Intl' [cmake] -- Conan: Target declared 'Iconv::Iconv' [cmake] -- Conan: Component target declared 'SQLite::SQLite3' [cmake] -- Conan: Component target declared 'libpq::pgport' [cmake] -- Conan: Component target declared 'libpq::pgcommon' [cmake] -- Conan: Component target declared 'libpq::pq' [cmake] -- Conan: Target declared 'PostgreSQL::PostgreSQL' [cmake] -- Conan: Component target declared 'md4c::md4c' [cmake] -- Conan: Component target declared 'md4c::md4c-html' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Core/conan_qt_executables_variables.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Core/conan_qt_qt6_coreprivate.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Core/conan_qt_entry_point.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/Qt6ConfigExtras.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicAppleHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicCMakeHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicCMakeVersionHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicFinalizerHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicFindPackageHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicPluginHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicTargetHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicTestHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicToolHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicWalkLibsHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6/QtPublicWasmToolchainHelpers.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Core/Qt6CoreMacros.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Core/Qt6CoreConfigExtras.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Gui/conan_qt_qt6_guiprivate.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Widgets/conan_qt_qt6_widgetsprivate.cmake' [cmake] -- Conan: Including build module from 'C:/Conan/b/qtefe25631c5079/p/lib/cmake/Qt6Widgets/Qt6WidgetsMacros.cmake' [cmake] -- Configuring done (0.4s) [cmake] -- Generating done (0.1s) [cmake] -- Build files have been written to: D:/Qt/build [main] Building folder: Qt akash [build] Starting build [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build D:/Qt/build --config Debug --target akash [build] MSBuild version 17.8.3+195e7f5a3 for .NET Framework [build] [build] Automatic MOC and UIC for target akash [build] Creating library D:/Qt/build/src/Debug/akash.lib and object D:/Qt/build/src/Debug/akash.exp [build] Qt6Guid.lib(qrhid3d12.cpp.obj) : error LNK2019: unresolved external symbol D3D12SerializeVersionedRootSignature referenced in function "public: bool __cdecl QD3D12MipmapGenerator::create(class QRhiD3D12 *)" (?create@QD3D12MipmapGenerator@@QEAA_NPEAVQRhiD3D12@@@Z) [D:\Qt\build\src\akash.vcxproj] [build] Qt6Guid.lib(qrhid3d12.cpp.obj) : error LNK2019: unresolved external symbol D3D12CreateDevice referenced in function "public: virtual bool __cdecl QRhiD3D12::create(class QFlags<enum QRhi::Flag>)" (?create@QRhiD3D12@@UEAA_NV?$QFlags@W4Flag@QRhi@@@@@Z) [D:\Qt\build\src\akash.vcxproj] [build] Qt6Guid.lib(qrhid3d12.cpp.obj) : error LNK2019: unresolved external symbol D3D12GetDebugInterface referenced in function "public: virtual bool __cdecl QRhiD3D12::create(class QFlags<enum QRhi::Flag>)" (?create@QRhiD3D12@@UEAA_NV?$QFlags@W4Flag@QRhi@@@@@Z) [D:\Qt\build\src\akash.vcxproj] [build] D:\Qt\build\src\Debug\akash.exe : fatal error LNK1120: 3 unresolved externals [D:\Qt\build\src\akash.vcxproj] [proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build D:/Qt/build --config Debug --target akash exited with code: 1 [driver] Build completed: 00:00:05.326 [build] Build finished with exit code 1 [main] ======================================================= [main] No executable target was found to launch. Please check: [main] - Have you called add_executable() in your CMake project? [main] - Have you executed a successful CMake configure? [main] No program will be executed