#lld-link error undefined symbol in6addr_any

1 messages · Page 1 of 1 (latest)

lapis pier
#

Hello, I'm trying to build a C library that uses some ipv6 functions.
I'm using Windows and when compiling it with zig I get this linking error:

>>> referenced by C:\dev\destral_zig\zig-cache\o\c3cc2180f529e2197e4ade0dab04f72a\enet.obj:(enet_address_get_host_ip_new)

lld-link: error: undefined symbol: in6addr_any
>>> referenced by C:\dev\destral_zig\zig-cache\o\c3cc2180f529e2197e4ade0dab04f72a\enet.obj:(.refptr.in6addr_any)

I'm linking with this libraries:

    exe.linkSystemLibrary("winmm");
    exe.linkSystemLibrary("ws2_32");

What am I missing? I know that the zig std library uses these functions/symbols without problems..

still oyster
lapis pier
#

@still oyster thanks but same link error.. 😦

lapis pier
#

Ok.. maybe the problem is that I'm linking with the windows libraries and I have to link with the libraries provided by the zig compiler? (I'm using the native target)

still oyster
#

run with --verbose-link and post the output

lapis pier
still oyster
#

try adding wsock32 as SystemLibrary

lapis pier
#

same error

#

:S

still oyster
#

hmm hmm hmm

#

can you post the output of zig env

lapis pier
#

PS C:\dev\destral_zig> zig env
{
"zig_exe": "C:\Zig\zig.exe",
"lib_dir": "C:\Zig\lib",
"std_dir": "C:\Zig\lib\std",
"global_cache_dir": "C:\Users\Dani\AppData\Local\zig",
"version": "0.10.0-dev.3871+b7d5582de"
}

still oyster
#

have you tried a newer version? I were hoping it would print out the exact target it refers to as native

lapis pier
#
{
 "zig_exe": "C:\\Zig\\zig.exe",
 "lib_dir": "C:\\Zig\\lib",
 "std_dir": "C:\\Zig\\lib\\std",
 "global_cache_dir": "C:\\Users\\Dani\\AppData\\Local\\zig",
 "version": "0.10.0-dev.4280+c3d67c5c4",
 "target": "x86_64-windows.win10_fe...win10_fe-gnu"
}```
#

@still oyster updated zig, it shows: x86_64-windows.win10_fe

faint cape
#

Any solution to this problem?

jolly steeple
#

IN6_IS_ADDR_V4MAPPED isn't a windows thing

#

That's probably why