-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windows
Milestone
Description
zig cc --target=x86_64-windows-gnu is unable to compile some files which compile correctly with mingw.
Example a.c
#ifdef __linux__
#include <netinet/in.h>
#else
#include <ws2tcpip.h>
#endif
int foo(void) {
struct in6_addr a = IN6ADDR_ANY_INIT;
struct in6_addr b = IN6ADDR_LOOPBACK_INIT;
return IN6_IS_ADDR_UNSPECIFIED(&a) + IN6_IS_ADDR_LOOPBACK(&b);
}
int main(int argc, char **argv) {
foo();
} Compiles correctly:
$ gcc -o a.o -Wall example.c
$ x86_64-w64-mingw32-gcc -o a.o -Wall a.c -lws2_32Zig fails:
$ zig cc --target=x86_64-windows-gnu -o a.o -Wall a.c -lws2_32
lld-link: error: undefined symbol: IN6_IS_ADDR_UNSPECIFIED
>>> referenced by /home/kk/.cache/zig/o/cb1ef5227d898d0797e8458d2db4fa8e/example.obj:(foo)
lld-link: error: undefined symbol: IN6_IS_ADDR_LOOPBACK
>>> referenced by /home/kk/.cache/zig/o/cb1ef5227d898d0797e8458d2db4fa8e/example.obj:(foo)Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-windows