capy-ui/capy

build error on windows

thisismz opened this issue · 2 comments

I just got compile error :

LLD Link... error(link): DLL import library for -lgdiplus not found
error: DllImportLibraryNotFound
zguit...The following command exited with error code 1:
C:\zig_10_dev\zig.exe build-exe E:\Study\zig\zguit\src\main.zig --cache-dir E:\Study\zig\zguit\zig-cache --global-cache-dir C:\Users\mahdimz\AppData\Local\zig --name zguit --pkg-begin zgt E:\Study\zig\zguit.zigmod\deps\git\github.com\zenith391\zgt\src\main.zig --pkg-end --enable-cache
error: the following build command failed with exit code 1:
E:\Study\zig\zguit\zig-cache\o\482da269c4a3f97e41f4573cc88c823a\build.exe C:\zig_10_dev\zig.exe E:\Study\zig\zguit E:\Study\zig\zguit\zig-cache C:\Users\mahdimz\AppData\Local\zig run

my system info is:

OS Name: Microsoft Windows 11 Enterprise
OS Version: 10.0.22000 N/A Build 22000
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~2592 Mhz

This happens when the following message is displayed:
LLVM Emit Object...

Ah yes, it's because I did some experimentation with GDI+ (because previously Canvas relied on GDI which wasn't a good choice given it dates back to Windows 3.1 days)

In the meantime you can copy src/backends/win32/gdiplus.def (in zgt source files).
Then go to the directory where you installed zig, go in lib/libc/mingw/lib-common and paste the file there.
Normally those steps are already done automatically in build.zig but I'll try to find why it didn't work for you, in the mean time I'm leaving this issue opened.

Fixed in 5f5660c by changing the instructions so that build_zgt.zig is properly used.