td: Build fails on VS2022

Build fails on VS2022

c:\Projects\td\build (master -> origin)
λ cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version  to target Windows 10.0.19044.
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:9 (project):
  No CMAKE_CXX_COMPILER could be found.



CMake Error at CMakeLists.txt:9 (project):
  No CMAKE_C_COMPILER could be found.



-- Configuring incomplete, errors occurred!
See also "C:/Projects/td/build/CMakeFiles/CMakeOutput.log".
See also "C:/Projects/td/build/CMakeFiles/CMakeError.log".

c:\Projects\td\build (master -> origin)
λ

Logs: CMakeError.log CMakeOutput.log

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

Works perfectly now. I included more SDK and compiler versions for older VS 2019

c:\Projects\td\build (master -> origin)
λ cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19044.
-- The CXX compiler identification is MSVC 19.31.31104.0
-- The C compiler identification is MSVC 19.31.31104.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find ccache (this is NOT an error)
-- Found OpenSSL: C:/Projects/td/vcpkg/installed/x64-windows/debug/lib/libcrypto.lib (found version "1.1.1l")
-- Found OpenSSL: C:/Projects/td/vcpkg/installed/x64-windows/include C:/Projects/td/vcpkg/installed/x64-windows/debug/lib/libssl.lib;C:/Projects/td/vcpkg/installed/x64-windows/debug/lib/libcrypto.lib
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found ZLIB: optimized;C:/Projects/td/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Projects/td/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.11")
-- Found ZLIB: C:/Projects/td/vcpkg/installed/x64-windows/include optimized;C:/Projects/td/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Projects/td/vcpkg/installed/x64-windows/debug/lib/zlibd.lib
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Success
-- Could NOT find Readline (missing: READLINE_INCLUDE_DIR READLINE_LIBRARY)
-- Could NOT find Readline (this is NOT an error)
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/td/build

Then you should have a Windows Kit installed and kernel32.lib inside the Windows Kit.