Fix mDNS on Windows machines with multiple network adapters (#13993)

ws2_32 (Winsock2) and wsock32 (Winsock) are not supposed to be used in the same application.
boost::asio requires ws2_32, but wxWidgets uses wsock32.
Which gets used depends on the order they appear in the link command, as they both define the same symbols, but with different behaviour.
ws2_32 is backwards-compatible with wsock32, so wxWidgets won't be negatively affected by linking with the newer version, and prior to c228ab2da1, that's what happened.
That commit reordered how some libraries were passed to the linker, so swapped the order of these two, breaking mDNS and causing https://github.com/OrcaSlicer/OrcaSlicer/issues/13969
This commit is contained in:
Chris Djali
2026-06-06 16:33:51 +01:00
committed by GitHub
parent f51b9961d2
commit d8fd2ed055

View File

@@ -158,7 +158,7 @@ target_link_libraries(OrcaSlicer libslic3r_gui)
if (MSVC)
# Generate debug symbols even in release mode.
target_link_options(OrcaSlicer PUBLIC "$<$<CONFIG:RELEASE>:/DEBUG>")
target_link_libraries(OrcaSlicer user32.lib Setupapi.lib)
target_link_libraries(OrcaSlicer ws2_32.lib user32.lib Setupapi.lib)
elseif (MINGW)
target_link_libraries(OrcaSlicer ws2_32 uxtheme setupapi)
elseif (APPLE)