Issue with building old version of grpc C++ static lib for Windows

I’m trying to build grpc C++ static lib using vcpkg for platform toolset v141, but get an error building a dependency lib re2:

Installing 8/11 re2:x64-windows@2023-07-01...
Building re2:x64-windows@2023-07-01...
-- Downloading https://github.com/google/re2/archive/2023-07-01.tar.gz -> google-re2-2023-07-01.tar.gz...
-- Extracting source C:/Source/Repos/vcpkg/downloads/google-re2-2023-07-01.tar.gz
-- Using source at C:/Source/Repos/vcpkg/buildtrees/re2/src/2023-07-01-5f6ab6c906.clean
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:127 (message):
    Command failed: C:/Source/Repos/vcpkg/downloads/tools/ninja/1.10.2-windows/ninja.exe -v
    Working Directory: C:/Source/Repos/vcpkg/buildtrees/re2/x64-windows-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:SourceReposvcpkgbuildtreesre2config-x64-windows-dbg-CMakeCache.txt.log
      C:SourceReposvcpkgbuildtreesre2config-x64-windows-rel-CMakeCache.txt.log
      C:SourceReposvcpkgbuildtreesre2config-x64-windows-out.log
Call Stack (most recent call first):
  installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:252 (vcpkg_execute_required_process)
  ports/re2/portfile.cmake:9 (vcpkg_cmake_configure)
  scripts/ports.cmake:192 (include)
error: building re2:x64-windows failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle re2:x64-windows: 2.8 s
Please ensure you're using the latest port files 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+re2
You can submit a new issue at:
  https://github.com/microsoft/vcpkg/issues/new?title=[re2]+Build+error+on+x64-windows&body=Copy+issue+body+from+C%3A%2FSource%2FRepos%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md

What I tried so far:

  1. git checkout 8184c5e — ports/<port> for ports abseil, grpc, openssl, protobuf, re2, upb, zlib, vcpkg-cmake, vcpkg-cmake-get-vars and vcpkg-cmake-config. The reason is that commit 8184c5e contains the last version matching v141 toolset, see https://github.com/microsoft/vcpkg/blob/8184c5e06c6bbf0f9ba67ab9e9b8b5b5202d6c08/ports/abseil/vcpkg.json and https://github.com/abseil/abseil-cpp/blob/20230125.4/absl/base/policy_checks.h
  2. Changed appropriate triplets. I have both installed VS2017 and VS2022.
    set(VCPKG_PLATFORM_TOOLSET v141)
    set(VCPKG_TARGET_ARCHITECTURE x64)
    set(VCPKG_CRT_LINKAGE dynamic)
    set(VCPKG_LIBRARY_LINKAGE dynamic)
    
  3. Remove vcpkg folders installed, packages and downloads for any artifacts and call .vcpkg install grpc:x64-windows

In config-x64-windows-dbg-CMakeCache.txt.log there are e.g. a variable MAKECOMMAND referencing to cmake.exe for v143 too, but I don’t know if this important. However, compiler and linker are for v141. Could you give me a hint what to look for?

Also I see some errors on ninja package. Which version should I use instead?

UPD: config-x64-windows-out.log contains a reference to VS2022 cmake:

[1/2] "C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" ...
-- The CXX compiler identification is MSVC 19.16.27051.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:40 (message):
  you need Visual Studio 2019 or later

Where can I edit CMakeList of re2?

1

I solved this by using another version of re2 package, which was built for v141, see https://github.com/microsoft/vcpkg/blob/2023.07.21/ports/re2/vcpkg.json and https://github.com/google/re2/blob/2023-02-01/CMakeLists.txt i.e.

git checkout 6b8fd05 — ports/re2

However, I still have problems running my code, but it is out of the scope of this question.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật