#Undefined symbol errors trying to link with static libraries (libnss)

1 messages · Page 1 of 1 (latest)

graceful pine
#

I'd recommend using addObjectFile rather than addLibraryPath+linkSystemLibrary for adding static libraries from a fixed location

#

(it's a misleading name, it'll work for both object files and static libraries)

narrow furnace
#

could it be an issue with libnss_static.a?

graceful pine
#

Yeah I didn't expect that to fix it, it should be equivalent :)

#

nm will show symbols the library depends on, as well as ones it defines

#

The U here means "undefined"

#

So you need a different library that does define them

narrow furnace
#

i'll run it on my output dir from nss

#

I copied some library files over but probably missed some

graceful pine
#

run what?

narrow furnace
#

nm*

graceful pine
#

oh right

narrow furnace
#

and check the symbols are defined somewhere

graceful pine
#

Yeah any static library in the output directory should probably be copied over into your deps dir

#

And linked to your zig program

narrow furnace
#

theres a lot of static libs there