From 5477571a80ad531a5a274d81d289b8c7e21cb802 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Tue, 12 Aug 2025 13:39:41 -0600 Subject: [PATCH] Link to the Windows standard libraries on Windows for ++ --- cpp/examples/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt index cea3aca..c04a0eb 100644 --- a/cpp/examples/CMakeLists.txt +++ b/cpp/examples/CMakeLists.txt @@ -56,6 +56,16 @@ foreach(EXAMPLE_FILE ${EXAMPLE_SOURCES}) "-framework IOKit" "-framework CFNetwork" ) + elseif (WIN32) + # System libs required by Rust std/tokio/reqwest/ring on Windows + target_link_libraries(${EXAMPLE_NAME} PRIVATE + ws2_32 # WSAStartup/WSACleanup, closesocket, freeaddrinfo + userenv # GetUserProfileDirectoryW + ntdll # NtReadFile, RtlNtStatusToDosError + bcrypt # ring RNG (BCryptGenRandom) + # iphlpapi # (optional) GetAdaptersAddresses, if you ever see it unresolved + # secur32 crypt32 ncrypt # (only if you switch to schannel/native-tls) + ) endif() endforeach()