Comments (6)
I was getting the same error, though I've had some success with
PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig
CGO_ENABLED=1
GOOS=windows
CC="x86_64-w64-mingw32-gcc"
go build -v -ldflags -H=windowsgui
taken from here but now I am getting the errors below:
main
# main
/usr/lib/golang/pkg/tool/linux_amd64/link: running x86_64-w64-mingw32-gcc failed: exit status 1
/usr/lib/gcc/x86_64-w64-mingw32/13.2.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -ladwaita-1: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/13.2.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgirepository-1.0: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/13.2.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgirepository-1.0: No such file or directory
/usr/lib/gcc/x86_64-w64-mingw32/13.2.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgirepository-1.0: No such file or directory
collect2: error: ld returned 1 exit status
from gotk4.
After going on a hunt to find the required packages I found the needed files here.
The mingw packages for libadwaita
and and gobject-introspection
do not seem to exist for Fedora.
After placing the package in the appropriate location I managed to compile my app.
As a small sidenote: bcryptprimitives.dll
was missing when I tried to run the app with Wine. It appears, this dll is only included with Wine 9 and seems to be required see here.
from gotk4.
After going on a hunt to find the required packages I found the needed files here.
How did you install the corresponding packages?
I didn't have any problem with libadwaita after extracting the .tar.zst file in /usr/x86_64-w64-mingw32/
But with gobject-introspection it was not the case...
github.com/diamondburned/gotk4/pkg/core/gerror
# github.com/diamondburned/gotk4/pkg/core/gerror
# [pkg-config --cflags -- glib-2.0 gobject-introspection-1.0]
Package gobject-introspection-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-introspection-1.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gobject-introspection-1.0', required by 'virtual:world', not found
So I decided to do this:
find /usr/x86_64-w64-mingw32/ -name "gobject-introspection-1.0.pc"
# /usr/x86_64-w64-mingw32/lib/pkgconfig/gobject-introspection-1.0.pc
ln /usr/x86_64-w64-mingw32/lib/pkgconfig/gobject-introspection-1.0.pc /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig
But I get this error
github.com/diamondburned/gotk4/pkg/core/gerror
# github.com/diamondburned/gotk4/pkg/core/gerror
# [pkg-config --cflags -- glib-2.0 gobject-introspection-1.0]
Package dependency requirement 'glib-2.0 >= 2.78.0' could not be satisfied.
Package 'glib-2.0' has version '2.77.1', required version is '>= 2.78.0'
Package dependency requirement 'gobject-2.0 >= 2.78.0' could not be satisfied.
Package 'gobject-2.0' has version '2.77.1', required version is '>= 2.78.0'
But I fixed it by modifying the file /usr/x86_64-w64-mingw32/lib/pkgconfig/gobject-introspection-1.0.pc
Changing these lines from this: Requires: glib-2.0 >= 2.78.0, gobject-2.0 >= 2.78.0
to this Requires: glib-2.0 >= 2.77.1, gobject-2.0 >= 2.77.1
I just want to know how safe it is to do that, or if the program will even work?
Or if I downloaded a wrong package that's why I had to do all the extra processing?
I leave this to leave more or less documented the process of how to get to this... in theory you just have to download and extract these 3 packages in /usr/x86_64-w64-mingw32/
And install these packages through dnf
- mingw64-gtk4
- mingw64-gcc
- zstd (To extract the packages)
Right now I already have a docker image to be able to automate it so... it would already be
from gotk4.
Why not use MSYS2?
from gotk4.
Why not use MSYS2?
MSYS2 compiles for Windows on Windows, mingw32 compiles for Windows on Linux. Running a separate machine/VM with windows, specially in a CI environment, is extra hassle which can be avoided by just cross-compiling.
from gotk4.
Oh, interesting. That's a use case that I've never considered, unfortunately.
from gotk4.
Related Issues (20)
- Support binding Go objects to GObjects with `GObject.set_qdata`
- How to use GTK 4 GridView with gio.ListStore and gtk.BuilderListItemFactory HOT 2
- pkg-config not working from cgo in snap HOT 7
- Apply for GNOME Circle HOT 1
- SIGSEGV: segmentation violation when using a go routine inside gtk.DropTarget.Connect HOT 8
- Migrate g_log to log/slog HOT 1
- SetShowArrow seems to be missing on gtk.DropDown HOT 1
- Widget memory is not freed when removed HOT 9
- VTE bindings HOT 14
- Add core/glib.PID built-in
- Panic in ListBox.ConnectRowSelected HOT 10
- Add a definition for GTK_INVALID_LIST_POSITION HOT 2
- GtkListView scroll_to missing HOT 1
- Segmentation fault when calling widget functions inside a goroutine HOT 4
- DragEnd on DragSource not being fired when dragged outside of app
- Error when initializing listview with empty list HOT 2
- ConnectCommandLine, how to close remote application?
- Missing: Information trees HOT 14
- gtk.Picture memory leak
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gotk4.