I encountered some issues while setting up the environment to build QField on Windows 10.
Reproduction steps
Steps to reproduce the behavior:
I am using CMake version 3.29.5, vcpkg version vcpkg2023-07-19, and QField version 3.0.5.
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”
An error occurred during the build process at qca-qt6:x64-windows-static. The screenshot is as follows:
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
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:
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:
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