diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 2f731ced22..d21d70535e 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -891,5 +891,10 @@ if (!build_with_chromium) { "//third_party/abseil-cpp/absl/flags:flag", "//third_party/abseil-cpp/absl/flags:parse", ] + if (is_win) { + deps += [ + "../rtc_base:win32_socket_init", + ] + } } } diff --git a/examples/stunprober/main.cc b/examples/stunprober/main.cc index 7c180d661e..023c52fa0e 100644 --- a/examples/stunprober/main.cc +++ b/examples/stunprober/main.cc @@ -28,6 +28,10 @@ #include "rtc_base/time_utils.h" #include "test/scoped_key_value_config.h" +#ifdef WEBRTC_WIN +#include "rtc_base/win32_socket_init.h" +#endif // WEBRTC_WIN + using stunprober::AsyncCallback; using stunprober::StunProber; @@ -108,6 +112,9 @@ void StopTrial(rtc::Thread* thread, StunProber* prober, int result) { } // namespace int main(int argc, char* argv[]) { +#ifdef WEBRTC_WIN + rtc::WinsockInitializer winsock_init; +#endif // WEBRTC_WIN absl::ParseCommandLine(argc, argv); std::vector server_addresses;