Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5-base[latest]:x64-windows - single configuration builds of Qt (eg. release) are currently not supported #10586

Closed
heydojo opened this issue Mar 28, 2020 · 3 comments · Fixed by #10644
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@heydojo
Copy link
Contributor

heydojo commented Mar 28, 2020

Host Environment

  • OS: x64-windows
  • Compiler: Visual Studio 2019 Developer Command Prompt v16.5.0

To Reproduce

Steps to reproduce the behavior:
Set build types to release.
echo.set(VCPKG_BUILD_TYPE release)>> triplets\x64-windows.cmake
Install build Qt.
vcpkg install qt5-base[latest]:x64-windows
Build your Qt based C++ application with something like:
mkdir build && cd build
cmake .. -DQt5_DIR:PATH="%VCPKGDIR%\packages\qt5-base_x64-windows\share\cmake\Qt5"

Failure logs

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5Gui/Qt5GuiConfig.cmake:15 (message):
  The imported target "Qt5::Gui" references the file

     "H:/qt5/windows/vcpkg/packages/qt5-base_x64-windows/debug/bin/Qt5Guid.dll"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "H:/qt5/windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5Gui/Qt5GuiConfig.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5Gui/Qt5GuiConfig.cmake:37 (_qt5_Gui_check_file_exists)
  windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5Gui/Qt5GuiConfig.cmake:177 (_populate_Gui_target_properties)
  windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:115 (find_package)
  windows/vcpkg/packages/qt5-base_x64-windows/share/cmake/Qt5/Qt5Config.cmake:28 (find_package)
  CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!
See also "H:/qt5/build/CMakeFiles/CMakeOutput.log".

Specifically:

The imported target "Qt5::Gui" references the file

     "H:/qt5/windows/vcpkg/packages/qt5-base_x64-windows/debug/bin/Qt5Guid.dll"

  but this file does not exist.

Additional context

Please fix or revert the regression.
f8165f7#diff-f322c6a00cca5779dfc2edc84a72c0d7

https://github.com/microsoft/vcpkg/blob/master/ports/qt5-base/fixcmake.py#L30

Thanks.

@heydojo heydojo added the category:port-bug The issue is with a library, which is something the port should already support label Mar 28, 2020
@Neumann-A
Copy link
Contributor

In the mentioned commit I corrected the configs to correctly include release and debug libraries if build with vcpkg's defaults. (The configs where incorrect before)
I currently don't know if this is fully fixed in #9705 (or #9860 or #10009) (since I don't test single configuration builds) but I added in a few if(EXISTS "someqtlib") to the target properties population of the Qt targets. So it should be at least a bit better ;).
I also completely removed fixcmake.py in #9705 because the required fixes were to complicated to achieve when the configs were already generated

@JackBoosY JackBoosY self-assigned this Mar 30, 2020
@heydojo
Copy link
Contributor Author

heydojo commented Apr 1, 2020

@Neumann-A thanks for the reply.
Please disregard my previous comment. I read your comment again and tried your branch for the newer version of QT at #10009
The branch allows vcpkg release builds to complete. However I observed the following problems not seen in the current tree:

When compiling an application against your changes, the following error occurred: LINK : fatal error LNK1181: cannot open input file 'H:\vcpkg\packages\qt5-base_x64-windows\lib\qtmain.lib'

I then copied the file H:\vcpkg\packages\qt5-base_x64-windows\lib\manual-link\qtmain.lib to H:\vcpkg\packages\qt5-base_x64-windows\lib\qtmain.lib
(I still don't understand the need for this change, as qtmain.lib is always expected to be in /lib) and the build succeeded but that's not all.

I used windeployqt to add the required dll files to the compiled Qt application's directory, running the application displayed an error message about a missing plugin platform. I solved said issue by manually copying the file qwindows.dll to a new folder named platforms inside the application's directory. This allowed the application to start it's main window but ui elements were missing, QPushButton widgets were not working as expected and the application did not function at all as it should.

So, the specific issue reported in this report is solved by #10009 but the resulting applications built against the commits in that branch don't work correctly. The application I am building does build correctly against the current tree but not your changes.

@heydojo
Copy link
Contributor Author

heydojo commented Apr 2, 2020

Just adding that I tested #10644 and this issue is solved once it is merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants