Linking .dll.a MSYS2/MinGW

Hey! Do forgive me if I’m going about this in entirely the wrong way.

I’ve got a couple MSYS2 libraries I’m trying to link to. One includes a .a file and as far as I can tell that links fine. The other, ffms, only has a libffms2.dll.a file.

It looks like using

const target = b.standardTargetOptions(.{ .default_target = .{
    .abi = .gnu,
} });

should add .dll.a to the search path (see link: windows: look for more DLL import lib path names by andrewrk · Pull Request #9039 · ziglang/zig · GitHub)

but using obj.root_module.linkSystemLibrary("ffms2", .{}); only ends up searching for ffms2.dll, ffms2.lib, and libffms2.a.

Thanks!

this might work: obj.root_module.linkSystemLibrary("ffms2.dll", .{});

that way it should search libffms2.dll.a

I guess if there’s no other options I could check if the build is on windows and do that but it’d be nice if I could figure out why it’s not searching that to begin with lol

I’d suggest making an issue or pr regarding this, it definitely should search that combination.

There is:

1 Like