Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
Setup
- Download raylib release version 5 for MinGW
- Pull its contents into a directory local with the project,
./raylib
- Update build target to be MinGW (Windows + GNU = MinGW):
const target = b.standardTargetOptions(.{
.default_target = .{
.os_tag = .windows,
.cpu_arch = .x86_64,
.abi = .gnu
}
});
- Ensure you have your dependencies for
raylib linked
- Note the link modes below state
static, but the result is the same with dynamic as well.
exe.linkLibC();
exe.addIncludePath(b.path("./raylib/include"));
exe.addLibraryPath(b.path("./raylib/lib"));
exe.linkSystemLibrary2("uuid", .{
.preferred_link_mode = .static,
.needed = true
});
exe.linkSystemLibrary2("gdi32", .{
.preferred_link_mode = .static,
.needed = true
});
exe.linkSystemLibrary2("winmm", .{
.preferred_link_mode = .static,
.needed = true
});
- Attempt to have
build.zig link raylib dynamically
exe.linkSystemLibrary2("raylib", .{
.preferred_link_mode = .dynamic,
.needed = true,
});
- Attempt to run
zig build --verbose install. It should produce the following error:
error: error(link): DLL import library for -lraylib not found
error: DllImportLibraryNotFound
The attempting to search for the DLL seems to be tied to a raylib.lib file being present despite MinGW configuration using libraylib.a libraries. This might have been an oversight when parsing configurations to search for DLLs.
Expected Behavior
Expected behavior should be for Zig to be able to accurately find the DLL while using MinGW and not MSVC environment.
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
Setup
./raylibrayliblinkedstatic, but the result is the same withdynamicas well.build.ziglinkraylibdynamicallyzig build --verbose install. It should produce the following error:The attempting to search for the DLL seems to be tied to a
raylib.libfile being present despiteMinGWconfiguration usinglibraylib.alibraries. This might have been an oversight when parsing configurations to search for DLLs.Expected Behavior
Expected behavior should be for Zig to be able to accurately find the DLL while using MinGW and not MSVC environment.