Closed arthurmelton closed 4 months ago
Duplicate of #12073
Each @cImport causes the file to be translated again creating new, distinct types. This is why it is advisable to only have one @cImport in your project. See the documentation here https://ziglang.org/documentation/master/#cImport.
Zig Version
0.12.0-dev.3435+091aa54a3
Steps to Reproduce and Observed Behavior
You can get this error by compiling the following:
then build with
zig build-exe main.zig -lc $(pkg-config --cflags-only-I gtk4 libadwaita-1)
The output from compiling is the following:
Expected Behavior
I don't know exactly what is causing the problem, but I don't think
adwaita.h
is overwriting the struct. The code does work if you either addadwaita.h
to the other import, or removeadwaita.h
from the first import. If the struct is being overwritten, then maybe the error should try to express that.This was as minimal as I could get the code, as I have no idea what in particular it is upset about.