capy-ui / zig-template Goto Github PK
View Code? Open in Web Editor NEWSimple template for creating a Capy app in Zig
License: The Unlicense
Simple template for creating a Capy app in Zig
License: The Unlicense
I clone the template and running zig build run
gave me this error:
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run capy-template transitive failure
└─ zig build-exe capy-template Debug native 7 errors
/home/karbon/.cache/zig/p/12208a38cfabbe54287c076a9532b9f106e4b7122f66f75bccbd90d7dc5c31020384/src/backends/gtk/backend.zig:24:31: error: root struct of file 'atomic' has no member named 'Value'
var activeWindows = std.atomic.Value(usize).init(0);
Hello,
I was trying to run the example with zig build run, and I got the following errors:
gyulanemeth@Gyula-MacBook-Pro hello-capy % zig build run zig build-exe capy-template Debug native: error: the following command failed with 3 compilation errors: /Users/gyulanemeth/Desktop/zig-macos-x86_64-0.12.0-dev.163+6780a6bbf/zig build-exe /Users/gyulanemeth/private-workspace2/learn-zig/hello-capy/src/main.zig -lobjc -lc --cache-dir /Users/gyulanemeth/private-workspace2/learn-zig/hello-capy/zig-cache --global-cache-dir /Users/gyulanemeth/.cache/zig --name capy-template --mod zigimg::/Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/vendor/zigimg/zigimg.zig --mod capy:zigimg,zigwin32:/Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/main.zig --mod zigwin32::/Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/vendor/zigwin32/win32.zig --deps zigwin32,capy -framework CoreFoundation -framework AppKit -framework ApplicationServices -framework CoreData -framework Foundation --subsystem native --listen=- Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none) run transitive failure └─ run capy-template transitive failure └─ zig build-exe capy-template Debug native 3 errors /Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/window.zig:41:24: error: no field or member function named 'setCallback' in 'backends.macos.backend.Window' try window.peer.setCallback(.Resize, sizeChanged); ~~~~~~~~~~~^~~~~~~~~~~~ /Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/backends/macos/backend.zig:53:20: note: struct declared here pub const Window = struct { ^~~~~~ referenced by: main: src/main.zig:10:33 callMain: /Users/gyulanemeth/Desktop/zig-macos-x86_64-0.12.0-dev.163+6780a6bbf/lib/std/start.zig:574:32 remaining reference traces hidden; use '-freference-trace' to see all reference traces /Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/backends/macos/objc.zig:146:56: error: no field or member function named 'ptrBitWidth' in 'target.Target.Cpu.Arch' pub const CGFloat = switch (@import("builtin").cpu.arch.ptrBitWidth()) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ /Users/gyulanemeth/Desktop/zig-macos-x86_64-0.12.0-dev.163+6780a6bbf/lib/std/target.zig:809:26: note: enum declared here pub const Arch = enum { ^~~~ /Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/window.zig:107:18: error: no field or member function named 'setUserData' in 'backends.macos.backend.Window' self.peer.setUserData(self); ~~~~~~~~~^~~~~~~~~~~~ /Users/gyulanemeth/.cache/zig/p/1220406249366af87d110f791157cc89a356264557dfbd22804faf03a3be6b3291df/src/backends/macos/backend.zig:53:20: note: struct declared here pub const Window = struct { ^~~~~~ gyulanemeth@Gyula-MacBook-Pro hello-capy %
Capy supports building to WebAssembly, but as of now, it requires, manually changing addExecutable
to addSharedLibrary
.
This should already be done in the template.
Even better would be to have the same serve
step as in Capy's build.zig
, which spins up an HTTP server for local development.
Hi, I'm using zig 0.12.0-dev
, and got the following when running zig build
:
C:\code\repos\_zig\zig-template>c:\kit\zig\zig.exe version
0.12.0-dev.706+62a0fbdae
C:\code\repos\_zig\zig-template>zig build
C:\code\repos\_zig\zig-template>c:\kit\zig\zig.exe build
zig build-exe capy-template Debug native: error: the following command failed with 2 compilation errors:
C:\kit\zig\zig.exe build-exe C:\code\repos\_zig\zig-template\src\main.zig -lcomctl32 -lgdi32 -lgdiplus C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\src\backends\win32\res\x86_64.o --cache-dir C:\code\repos\_zig\zig-template\zig-cache --global-cache-dir C:\Users\TABRAP\AppData\Local\zig --name capy-template --mod capy:zigimg,zigwin32:C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\src\main.zig --mod zigimg::C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\vendor\zigimg\zigimg.zig --mod zigwin32::C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\vendor\zigwin32\win32.zig --deps zigwin32,capy --subsystem console --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install capy-template transitive failure
└─ zig build-exe capy-template Debug native 2 errors
C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\src\components\Slider.zig:60:30: error: invalid builtin function: '@fabs'
peer.*.?.setStepSize(@fabs(newValue));
^~~~~~~~~~~~~~~
C:\Users\TABRAP\AppData\Local\zig\p\1220bba06640df54f0c9e4d18449a43c6725cc706f8d631f7d5037de70ab5bd2259d\src\components\Slider.zig:81:37: error: invalid builtin function: '@fabs'
self.peer.?.setStepSize(@fabs(self.step.get()));
Any idea on how to make it work?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.