No CMake configuration found - Windows
-
So I'm trying to build the QField source code. I am on windows 11 using Qt creator. When I clone the specific branch of the repository I am trying to build I am given four errors that dont make any sense.
I installed QT6, QT5, CMake and Ninja when installing the creator. I even wiped my install, cleaned all the files from my pc and then performed a clean install but I still have the same errors.
When I go into Edit>Preference>Kits>CMake Qt automatically detected CMake and has a filepath stored
Then checking the VCPKG install log I get this information
Waiting to take filesystem lock on C:\Users\KianLeggett\Documents\QField\vcpkg\base\.vcpkg-root... Detecting compiler hash for triplet x64-windows... The following packages will be built and installed: * anyrpc[core]:x64-windows -> 2020-01-13#2 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\anyrpc * atlmfc[core]:x64-windows -> 0#1 * curl[core,non-http,schannel,ssl,sspi]:x64-windows -> 7.82.0 * exiv2[core,xmp]:x64-windows -> 0.27.5#1 * expat[core]:x64-windows -> 2.4.1 * freexl[core]:x64-windows -> 1.0.6 * gdal[core,hdf5,libspatialite,netcdf,postgresql,supported-default-features]:x64-windows -> 3.4.2 * geos[core]:x64-windows -> 3.10.0 * gsl[core]:x64-windows -> 2.7.1 * hdf5[core,szip,zlib]:x64-windows -> 1.12.1#4 * libgeotiff[core]:x64-windows -> 1.7.1 * libiconv[core]:x64-windows -> 1.16#12 * libpq[core,lz4,openssl,zlib]:x64-windows -> 14.1 * libspatialindex[core]:x64-windows -> 1.9.3 * libspatialite[core,freexl,geocallbacks]:x64-windows -> 5.0.1#5 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\libspatialite * libxml2[core]:x64-windows -> 2.9.12#5 * libzip[bzip2,core,default-aes,wincrypto]:x64-windows -> 1.8.0 * lz4[core]:x64-windows -> 1.9.3#3 * netcdf-c[core,dap,hdf5,nczarr,netcdf-4,platform-default-features]:x64-windows -> 4.8.1#2 * nlohmann-json[core]:x64-windows -> 3.10.5#2 * openjpeg[core]:x64-windows -> 2.4.0 * proj[core,net,tiff]:x64-windows -> 9.0.0 * protobuf[core]:x64-windows -> 3.19.4 * qca[core]:x64-windows -> 2.3.4 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\qca qgis[core]:x64-windows -> 3.18.0 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\qgis qt5-charts[core]:x64-windows -> 5.15.3 qt5-connectivity[core]:x64-windows -> 5.15.3 * qt5-graphicaleffects[core]:x64-windows -> 5.15.3 qt5-location[core]:x64-windows -> 5.15.3 qt5-multimedia[core]:x64-windows -> 5.15.3 * qt5-quickcontrols[core]:x64-windows -> 5.15.3 qt5-quickcontrols2[core]:x64-windows -> 5.15.3 qt5-sensors[core]:x64-windows -> 5.15.3 * qt5-serialport[core]:x64-windows -> 5.15.3 qt5-webview[core]:x64-windows -> 5.15.3 * qt5-winextras[core]:x64-windows -> 5.15.3#1 sentry-native[core]:x64-windows -> 0.4.15 spix[core]:x64-windows -> 0.3 * szip[core]:x64-windows -> 2.1.1#7 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\szip Additional packages (*) will be modified to complete this operation. Restored 0 packages from C:\Users\KianLeggett\AppData\Local\vcpkg\archives in 1.168 ms. Use --debug to see more details. Starting package 1/39: atlmfc:x64-windows Building package atlmfc[core]:x64-windows... -- [OVERLAY] Loading triplet configuration from: C:\Users\KianLeggett\Documents\QField\vcpkg\triplets\x64-windows.cmake CMake Error at ports/atlmfc/portfile.cmake:7 (message): Unable to locate 'afxres.h'. Ensure you have installed the ATL/MFC component of Visual Studio. Call Stack (most recent call first): scripts/ports.cmake:145 (include) Error: Building package atlmfc:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+atlmfc You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[atlmfc]+Build+error including: package: atlmfc[core]:x64-windows -> 0#1 vcpkg-tool version: 2022-03-25-d9702d9d89b9468c32efc3f18fb84c3021d7dbae vcpkg-scripts version: 5d3e0e8a2 2022-03-30 (4 months ago) Additionally, attach any relevant sections from the log files above. Waiting to take filesystem lock on C:\Users\KianLeggett\Documents\QField\vcpkg\base\.vcpkg-root... Detecting compiler hash for triplet x64-windows... The following packages will be built and installed: * anyrpc[core]:x64-windows -> 2020-01-13#2 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\anyrpc * atlmfc[core]:x64-windows -> 0#1 * curl[core,non-http,schannel,ssl,sspi]:x64-windows -> 7.82.0 * exiv2[core,xmp]:x64-windows -> 0.27.5#1 * expat[core]:x64-windows -> 2.4.1 * freexl[core]:x64-windows -> 1.0.6 * gdal[core,hdf5,libspatialite,netcdf,postgresql,supported-default-features]:x64-windows -> 3.4.2 * geos[core]:x64-windows -> 3.10.0 * gsl[core]:x64-windows -> 2.7.1 * hdf5[core,szip,zlib]:x64-windows -> 1.12.1#4 * libgeotiff[core]:x64-windows -> 1.7.1 * libiconv[core]:x64-windows -> 1.16#12 * libpq[core,lz4,openssl,zlib]:x64-windows -> 14.1 * libspatialindex[core]:x64-windows -> 1.9.3 * libspatialite[core,freexl,geocallbacks]:x64-windows -> 5.0.1#5 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\libspatialite * libxml2[core]:x64-windows -> 2.9.12#5 * libzip[bzip2,core,default-aes,wincrypto]:x64-windows -> 1.8.0 * lz4[core]:x64-windows -> 1.9.3#3 * netcdf-c[core,dap,hdf5,nczarr,netcdf-4,platform-default-features]:x64-windows -> 4.8.1#2 * nlohmann-json[core]:x64-windows -> 3.10.5#2 * openjpeg[core]:x64-windows -> 2.4.0 * proj[core,net,tiff]:x64-windows -> 9.0.0 * protobuf[core]:x64-windows -> 3.19.4 * qca[core]:x64-windows -> 2.3.4 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\qca qgis[core]:x64-windows -> 3.18.0 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\qgis qt5-charts[core]:x64-windows -> 5.15.3 qt5-connectivity[core]:x64-windows -> 5.15.3 * qt5-graphicaleffects[core]:x64-windows -> 5.15.3 qt5-location[core]:x64-windows -> 5.15.3 qt5-multimedia[core]:x64-windows -> 5.15.3 * qt5-quickcontrols[core]:x64-windows -> 5.15.3 qt5-quickcontrols2[core]:x64-windows -> 5.15.3 qt5-sensors[core]:x64-windows -> 5.15.3 * qt5-serialport[core]:x64-windows -> 5.15.3 qt5-webview[core]:x64-windows -> 5.15.3 * qt5-winextras[core]:x64-windows -> 5.15.3#1 sentry-native[core]:x64-windows -> 0.4.15 spix[core]:x64-windows -> 0.3 * szip[core]:x64-windows -> 2.1.1#7 -- C:/Users/KianLeggett/Documents/QField/vcpkg/overlay\szip Additional packages (*) will be modified to complete this operation. Restored 0 packages from C:\Users\KianLeggett\AppData\Local\vcpkg\archives in 1.168 ms. Use --debug to see more details. Starting package 1/39: atlmfc:x64-windows Building package atlmfc[core]:x64-windows... -- [OVERLAY] Loading triplet configuration from: C:\Users\KianLeggett\Documents\QField\vcpkg\triplets\x64-windows.cmake CMake Error at ports/atlmfc/portfile.cmake:7 (message): Unable to locate 'afxres.h'. Ensure you have installed the ATL/MFC component of Visual Studio. Call Stack (most recent call first): scripts/ports.cmake:145 (include) Error: Building package atlmfc:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+atlmfc You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[atlmfc]+Build+error including: package: atlmfc[core]:x64-windows -> 0#1 vcpkg-tool version: 2022-03-25-d9702d9d89b9468c32efc3f18fb84c3021d7dbae vcpkg-scripts version: 5d3e0e8a2 2022-03-30 (4 months ago) Additionally, attach any relevant sections from the log files above.
However I'm using the latest version of VCPKG on my machine. Any help would be greatly appreciated as I need to build this app as quick as possible.
-
@kl11 said in No CMake configuration found - Windows:
CMake Error at ports/atlmfc/portfile.cmake:7 (message):
Unable to locate 'afxres.h'. Ensure you have installed the ATL/MFC
component of Visual Studio.
Call Stack (most recent call first):
scripts/ports.cmake:145 (include)Is the error that you need to fix. This is done by starting Visual Studio setup and selecting ATL/MFC component.
-
@kl11 said in No CMake configuration found - Windows:
CMake Error at ports/atlmfc/portfile.cmake:7 (message):
Unable to locate 'afxres.h'. Ensure you have installed the ATL/MFC
component of Visual Studio.
Call Stack (most recent call first):
scripts/ports.cmake:145 (include)Is the error that you need to fix. This is done by starting Visual Studio setup and selecting ATL/MFC component.
@cristian-adam thankyou for the quick response. I'm sorry to ask but I don't have a lot of experience compiling, packaging and building. I would be very appreciative if you could describe how to do this or link a guide you recommend on the matter. Again thankyou
-
On your Windows machine (where I assume you have Visual Studio 2019 installed):
- Press 🪟 key, then type "Visual Studio Installer"
- Select your Visual Studio 2019 installation and click on "Modify" button.
- Then in the "Desktop development with C++" at the "Optional" packages select the packages:
- C++ ATL for latest v142 build tools
- C++ MFC for latest v142 build tools
- Click on the bottom "Modify" button and that should be it
-
You don't need Visual Studio open in parallel. You just need the compiler.
But, the screenshot that you've provided has more issues:
- No ninja binary, you need to have ninja-build installed. Either from Qt SDK or github.
- It looks you are using an Android Kit
If you are trying to target Android, then it's a bit more complicated with vcpkg, which is trying to build for
x64-windows
. -
On your Windows machine (where I assume you have Visual Studio 2019 installed):
- Press 🪟 key, then type "Visual Studio Installer"
- Select your Visual Studio 2019 installation and click on "Modify" button.
- Then in the "Desktop development with C++" at the "Optional" packages select the packages:
- C++ ATL for latest v142 build tools
- C++ MFC for latest v142 build tools
- Click on the bottom "Modify" button and that should be it
@cristian-adam I launched the project in VS and recieved these two errors:
Inspecting the logs for the first error I find
[1/1] cmd /c "cd .. && "C:/Users/KianLeggett/Documents/QField/vcpkg/base/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe" "C:/Users/KianLeggett/Documents/QField/vcpkg/base/buildtrees/libspatialindex/src/1.9.3-6cf20331d2.clean" "-DCMAKE_DEBUG_POSTFIX=d" "-DSIDX_BUILD_TESTS:BOOL=OFF" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Users/KianLeggett/Documents/QField/vcpkg/base/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/Users/KianLeggett/Documents/QField/vcpkg/base/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/Users/KianLeggett/Documents/QField/vcpkg/base" "-DZ_VCPKG_ROOT_DIR=C:/Users/KianLeggett/Documents/QField/vcpkg/base" "-D_VCPKG_INSTALLED_DIR=C:/Users/KianLeggett/Documents/QField/out/build/x64-Debug/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-Ax64" "-G" "Visual Studio 17 2022" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/Users/KianLeggett/Documents/QField/vcpkg/base/packages/libspatialindex_x64-windows"" FAILED: ../CMakeCache.txt cmd /c "cd .. && "C:/Users/KianLeggett/Documents/QField/vcpkg/base/downloads/tools/cmake-3.22.2-windows/cmake-3.22.2-windows-i386/bin/cmake.exe" "C:/Users/KianLeggett/Documents/QField/vcpkg/base/buildtrees/libspatialindex/src/1.9.3-6cf20331d2.clean" "-DCMAKE_DEBUG_POSTFIX=d" "-DSIDX_BUILD_TESTS:BOOL=OFF" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/Users/KianLeggett/Documents/QField/vcpkg/base/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/Users/KianLeggett/Documents/QField/vcpkg/base/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/Users/KianLeggett/Documents/QField/vcpkg/base" "-DZ_VCPKG_ROOT_DIR=C:/Users/KianLeggett/Documents/QField/vcpkg/base" "-D_VCPKG_INSTALLED_DIR=C:/Users/KianLeggett/Documents/QField/out/build/x64-Debug/vcpkg_installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-Ax64" "-G" "Visual Studio 17 2022" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/Users/KianLeggett/Documents/QField/vcpkg/base/packages/libspatialindex_x64-windows"" -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000. -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:8 (project): No CMAKE_C_COMPILER could be found. CMake Error at CMakeLists.txt:8 (project): No CMAKE_CXX_COMPILER could be found. -- Configuring incomplete, errors occurred! See also "C:/Users/KianLeggett/Documents/QField/vcpkg/base/buildtrees/libspatialindex/x64-windows-rel/CMakeFiles/CMakeOutput.log". See also "C:/Users/KianLeggett/Documents/QField/vcpkg/base/buildtrees/libspatialindex/x64-windows-rel/CMakeFiles/CMakeError.log". ninja: build stopped: subcommand failed.
and the logs for the other error
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:128 (message): Command failed: ninja -v Working Directory: C:/Users/KianLeggett/Documents/QField/vcpkg/base/buildtrees/libspatialindex/x64-windows-rel/vcpkg-parallel-configure Error code: 1 See logs for more information: C:\Users\KianLeggett\Documents\QField\vcpkg\base\buildtrees\libspatialindex\config-x64-windows-out.log Call Stack (most recent call first): scripts/cmake/vcpkg_configure_cmake.cmake:345 (vcpkg_execute_required_process) ports/libspatialindex/portfile.cmake:11 (vcpkg_configure_cmake) scripts/ports.cmake:145 (include) Error: Building package libspatialindex:x64-windows failed with: BUILD_FAILED Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`. Then check for known issues at: https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+libspatialindex You can submit a new issue at: https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[libspatialindex]+Build+error including: package: libspatialindex[core]:x64-windows -> 1.9.3 vcpkg-tool version: 2022-03-25-d9702d9d89b9468c32efc3f18fb84c3021d7dbae vcpkg-scripts version: 5d3e0e8a2 2022-03-30 (4 months ago)
These are copies of the errors I'm facing within Qt creator, do I bother fixing them in Visual studio or Qt?
-
Visual Studio is somehow missing the C and C++ compilers. You need to make sure you have a valid Visual Studio setup for developing C and C++ applications.
-
Visual Studio is somehow missing the C and C++ compilers. You need to make sure you have a valid Visual Studio setup for developing C and C++ applications.
@cristian-adam Hey there, So ive had a look in the VS installer tool and I do have both c and c++ compilers. I also checked the Qt maintenence tool and I found ninja is already installed.
-
Qt Creator has a "Hello World" vcpkg CMake project at https://github.com/qt-creator/qt-creator/tree/master/tests/manual/vcpkg
You should be able to open the project in Qt Creator and build it like this:
-
So I managed to get around the issue
This is how I solved it:
- Uninstall Visual Studio + packages, Qt and everything related to it. Even like the SDK, NDK + JDK
- Run a clean with CCleaner
- Restart machine
- Re install Qt + Visual studio and appropriate packages
- clone vcpkg repository
- follow build instructions in there and create an executable
However I have encountered a different error which I will post in another forum entry