Building QField on Windows 10: Failed to install qca-qt6

Describe the issue

I encountered some issues while setting up the environment to build QField on Windows 10.

Reproduction steps

Steps to reproduce the behavior:

  1. I am using CMake version 3.29.5, vcpkg version vcpkg2023-07-19, and QField version 3.0.5.
  2. According to the development documentation, the CMake command I used to build is:
    cmake -S QField -B build -D VCPKG_TARGET_TRIPLET=x64-windows-static -D VCPKG_INSTALL_OPTIONS=“–x-buildtrees-root=D:/build” -D PKG_CONFIG_EXECUTABLE=“C:/src/vcpkg/packages/pkgconf_x64-windows/tools/pkgconf/pkgconf.exe”
  3. An error occurred during the build process at qca-qt6:x64-windows-static. The screenshot is as follows:

    The log file screenshots are as follows:

Expected behavior

Could you please suggest possible solutions for this issue?
One additional point: I chose vcpkg version vcpkg2023-07-19 because higher versions of vcpkg use Python 3.11 for installing QField, which always results in errors. Therefore, I opted for a lower version of vcpkg.
Could you update the development documentation to include the specific CMake and vcpkg versions required for the setup? This would help avoid unnecessary issues during installation.


Imported from GitHub discussion by @jzk-star on 2024-06-18T05:44:46Z

According to the docs, the command is slightly different from what you describe

cmake -S QField -B build \
  -D VCPKG_TARGET_TRIPLET=x64-windows-static \
  -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded\$<\$<CONFIG:Debug>:Debug> \
  -D PKG_CONFIG_EXECUTABLE=build/vcpkg_installed/x64-windows/tools/pkgconf/pkgconf.exe \
  -D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/build"

One thing I note here is that probably x64-windows should be x64-windows-static though.

Could you try with the documented instructions instead?


Imported from GitHub comment by @m-kuhn on 2024-06-18T10:19:47Z

This time, I strictly followed the commands provided in the development documentation, but it still failed


I tried to make some modifications to the commands in the documentation, mainly changing x64-windows to x64-windows-static. I copied the build/vcpkg_installed/x64-windows/tools/pkgconf folder to build/vcpkg_installed/x64-windows-static/tools/pkgconf and modified -D PKG_CONFIG_EXECUTABLE=build/vcpkg_installed/x64-windows/tools/pkgconf/pkgconf.exe to -D PKG_CONFIG_EXECUTABLE=build/vcpkg_installed/x64-windows-static/tools/pkgconf/pkgconf.exe.

Additionally, I removed the two \ in -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$CONFIG:Debug:Debug>.

Finally, the command I modified is: cmake -S QField -B build -D VCPKG_TARGET_TRIPLET=x64-windows-static -D CMAKE_MSVC_RUNTIME_LIBRARY=“MultiThreaded$<$CONFIG:Debug:Debug>” -D PKG_CONFIG_EXECUTABLE=“build/vcpkg_installed/x64-windows-static/tools/pkgconf/pkgconf.exe” -D VCPKG_INSTALL_OPTIONS=“–x-buildtrees-root=C:/build”.

I successfully installed a series of dependencies, but at the end of the build, some unexpected errors still occurred, as shown in the screenshots below:



I found similar issues in previous issues, but no solutions have been provided yet. Screenshots are as follows:


Imported from GitHub comment by @jzk-star on 2024-06-19T02:51:12Z

It looks like it’s almost done and failing in the very last step.
I am not completely sure what’s wrong there, this will need a bit of investigation on cmake side.

I would suggest to also ask in the existing discussion and to leave a link to this discussion in here.


Imported from GitHub comment by @m-kuhn on 2024-06-19T05:49:24Z

I am temporarily unable to find the cause of the error, so I tried to build another release version of QField.
I changed the QField version from 3.0.5 to 3.3.2.
However, higher versions of QField often correspond to higher versions of vcpkg. When using vcpkg versions greater than vcpkg2023-07-19, the Python version used during the build process changes to Python 3.11 (previously it was Python 3.10 when building QField 3.0.5). During the installation of dependencies with vcpkg, I always encounter the error “python ImportError: DLL load failed while importing _socket” (this information is read from the log).
The command I used is still cmake -S QField -B build -D VCPKG_TARGET_TRIPLET=x64-windows-static -D CMAKE_MSVC_RUNTIME_LIBRARY=“MultiThreaded$<$CONFIG:Debug:Debug>” -D PKG_CONFIG_EXECUTABLE=“build/vcpkg_installed/x64-windows-static/tools/pkgconf/pkgconf.exe” -D VCPKG_INSTALL_OPTIONS=“–x-buildtrees-root=D:/build”.
The error screenshot is as follows:


The content of the error log file is as follows:


Imported from GitHub comment by @jzk-star on 2024-06-19T08:27:38Z

I don’t know what your ultimate goal is with QField, but for the record: it’s now also possible to customize it through plugins. Supercharge your fieldwork with QField’s project and app-wide plugins – OPENGIS.ch


Imported from GitHub comment by @m-kuhn on 2024-06-19T08:36:36Z

Using QField is intended for mobile development.


Imported from GitHub comment by @jzk-star on 2024-06-19T08:43:58Z

jzk-star , you should try to see if your needs can be fulfilled by writing a plugin for QField instead of going through the burden of self-compilation (as well as the follow up maintenance burden of keep up to date with releases).

If you are exploring the plugin option, let us know how it goes!


Imported from GitHub comment by @nirvn on 2024-06-19T09:59:46Z