#Statically link C library

1 messages · Page 1 of 1 (latest)

wet carbon
#

I have a C library (specifically vkd3d-shader) that i would like to link statically, i have it in the right place i think and have pointed the compiler to it

vkd3d_shim.addLibraryPath("./");
vkd3d_shim.linkSystemLibraryName("libvkd3d-shader");
``` yet it fails to link saying `unable to find library -llibvkd3d-shader`
#

full build.zig

indigo harbor
#

Pretty sure you're supposed to use vkd3d_shim.linkSystemLibraryName("vkd3d-shader");
?

wet carbon
#

oh yeah that made it find it, now its just throwing errors because vkd3d-shader wasnt compiled with -fPIC

#

which i believe i can just pass to the compile command of vkd3d

indigo harbor
#

You could also always port vkd32-shader compilation to Zig

wet carbon
#

this isnt intended for a zig consumer, im just using the zig toolchain to build a C lib, to then be consumed by C#