I seem to be encountering issues when attempting to build a small application that links against the WinSock library. I have tried multiple things such as adding my Windows SDK to the linker args as well as explicitly adding the winsock library to the libraries of the executable component.
Here is what my build.gradle looks like:
model {
components {
main(NativeExecutableSpec){
sources {
cpp {
source {
srcDir 'src/'
include '**/*.cpp'
include '**/*.h'
}
}
}
}
}
binaries {
all {
if (toolChain in VisualCpp) {
linker.args "/SUBSYSTEM:CONSOLE"
}
}
withType(NativeExecutableSpec) {
lib library: "WS2_32", linkage: "static"
}
}
}