Questions with regard to developing Qt GUI apps using VS2022, Qt VS Tools and Vcpkg manifest
-
Hi all,
I'm developing Qt GUI apps using Visual Studio 2022 (with Qt VS Tools extension). The Qt build tools are set up via Vcpkg in manifest mode. I'm having some issues/questions with this set up.
Before I dive deep into those issues, let me explain what I have done to get me there. I might make a mistake and probably someone will spot it.
1. Installed "Qt Visual Studio Tools" extension to VS2022. 2. Prepared a blank vcpkg installation and integrated it to VS2022. 3. Prepared a vcpkg.json manifest file, containing qtbase. Put it at the root of project. 4. Created a blank dummy VS project at any location underneath the root in Step 3. Any type of project will do, for simplicity I created an empty console apps. · Changed the project configurations to use vcpkg in manifest mode. · Compiled the blank project. This installed qtbase package and all its dependencies. The default location is "vcpkg_installed" folder alongside the vcpkg.json manifest file. · At that point the empty project had done its role and was discarded. 5. Added the Qt version that created in step 4 to Qt VS Tools. 6. Created new Qt project in the old solution file from step 4 by using the wizard provided by Qt VS Tools (question 1). · After the project was created successfully, checked the configurations, made some adjustments. Namely vcpkg manifest mode should be set to "Yes". Also made sure the debug build was set correctly (question 2).
That's it. All seem good, the project can compile and run, except 2 parts above I marked with question.
Question 1:
When creating a new project via Qt project wizard, the wizard will be expecting for some files located at vcpkg_installed\x64-windows\x64-windows\tools\Qt6\mkspecs. However those files are actually located at vcpkg_installed\x64-windows\x64-windows\shared\Qt6\mkspecs. My workaround was to copy the mkspecs folder to the location where the wizard is expecting those files. Is this a known issue? Is other workaround exists so that there is no tedious of copying the mkspecs folder every time the Qt lib got recompiled.Question 2:
I noticed that for debug build, the wizard set both vcpkg build configuration and Qt build config to "Release". I changed those settings to Debug and the build failed due to the linker was looking for vcpkg_installed\x64-windows\x64-windows\lib\Qt6Widgetsd.lib, however it's actually located at vcpkg_installed\x64-windows\x64-windows\debug\Qt6Widgetsd.lib. Set the debug lib location to "Additional Qt library search path" does not cure the issue. Is there a workaround for this issue?Please let me know if I missed out something.
Thanks.
WH -
Hi all,
I'm developing Qt GUI apps using Visual Studio 2022 (with Qt VS Tools extension). The Qt build tools are set up via Vcpkg in manifest mode. I'm having some issues/questions with this set up.
Before I dive deep into those issues, let me explain what I have done to get me there. I might make a mistake and probably someone will spot it.
1. Installed "Qt Visual Studio Tools" extension to VS2022. 2. Prepared a blank vcpkg installation and integrated it to VS2022. 3. Prepared a vcpkg.json manifest file, containing qtbase. Put it at the root of project. 4. Created a blank dummy VS project at any location underneath the root in Step 3. Any type of project will do, for simplicity I created an empty console apps. · Changed the project configurations to use vcpkg in manifest mode. · Compiled the blank project. This installed qtbase package and all its dependencies. The default location is "vcpkg_installed" folder alongside the vcpkg.json manifest file. · At that point the empty project had done its role and was discarded. 5. Added the Qt version that created in step 4 to Qt VS Tools. 6. Created new Qt project in the old solution file from step 4 by using the wizard provided by Qt VS Tools (question 1). · After the project was created successfully, checked the configurations, made some adjustments. Namely vcpkg manifest mode should be set to "Yes". Also made sure the debug build was set correctly (question 2).
That's it. All seem good, the project can compile and run, except 2 parts above I marked with question.
Question 1:
When creating a new project via Qt project wizard, the wizard will be expecting for some files located at vcpkg_installed\x64-windows\x64-windows\tools\Qt6\mkspecs. However those files are actually located at vcpkg_installed\x64-windows\x64-windows\shared\Qt6\mkspecs. My workaround was to copy the mkspecs folder to the location where the wizard is expecting those files. Is this a known issue? Is other workaround exists so that there is no tedious of copying the mkspecs folder every time the Qt lib got recompiled.Question 2:
I noticed that for debug build, the wizard set both vcpkg build configuration and Qt build config to "Release". I changed those settings to Debug and the build failed due to the linker was looking for vcpkg_installed\x64-windows\x64-windows\lib\Qt6Widgetsd.lib, however it's actually located at vcpkg_installed\x64-windows\x64-windows\debug\Qt6Widgetsd.lib. Set the debug lib location to "Additional Qt library search path" does not cure the issue. Is there a workaround for this issue?Please let me know if I missed out something.
Thanks.
WHThere is an error in my original post. The system refuses to let me edit it. Here is the correction:
Question 2:
I noticed that for debug build, the wizard set both vcpkg build configuration and Qt build config to "Release". I changed those settings to Debug and the build failed due to the linker was looking for vcpkg_installed\x64-windows\x64-windows\lib\Qt6Widgetsd.lib, however it's actually located at vcpkg_installed\x64-windows\x64-windows\debug\ lib \Qt6Widgetsd.lib. Set the debug lib location to "Additional Qt library search path" does not cure the issue. Is there a workaround for this issue?Sorry for the confusion.
Thanks.
WH -
C Christian Ehrlicher moved this topic from General and Desktop on