Re: [gtk-osx-users] Hello World with gtk





On Aug 26, 2021, at 11:14 AM, David Price via gtk-osx-users-list <gtk-osx-users-list gnome org> wrote:

Hello

I finally managed to use jhbuild to install gtk.  Thanks to John Ralls for helping me with the Rust problem.

Now I am trying to do the basic GTK Hello World in Rust from 
"https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/"; and getting the following errors :


error: failed to run custom build command for `glib-sys v0.14.0`

process didn't exit successfully: 
`/Users/david/MyStuff/Rust/RustGTK/my-gtk-app/target/debug/build/glib-sys-a2f0018fbdfb445a/build-script-build`
 (exit status: 1)

cargo:warning=Failed to run `"pkg-config" "--libs" "--cflags" "glib-2.0" "glib-2.0 >= 2.66"`: No such file 
or directory (os error 2)


Was I supposed to set up a PATH variable for gtk (which has glib-2.68.0)?  If so, how?  Is it looking for 
glib in .cargo ?

Also, when I run just the build-script-build mentioned above, I get the following warning :

    cargo:warning=$CARGO_MANIFEST_DIR not set


If it helps, this is my $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/david/.cargo/bin:/Users/david/.new_local/bin

I am a newbie at all this, so any patient assistance would be appreciated


Sorry, those questions are mostly about rust, a topic about which I know next to nothing. You'll have to go 
ask for help from the gtk-rs.org folks.

Note, however, that Gtk-osx builds a self-contained working environment that is by design not exported to the 
rest of the system and which imports only the macOS SDK from the system because its purpose is to create a 
build environment that can create stand-alone application bundles for drag-and-drop installation on other 
users' Macs. That's not to say that you can't use it for your rust development, but you'll have to start a 
jhbuild shell and run rust from in there. Since gtk-osx isn't intended to work with rust there may also be 
additional environment variables that you'll have to set by hand; again, the place to ask for help about that 
is on the gtk-rs.org support channels. You'll probably have an easier time if you remove gtk-osx and use 
Homebrew or MacPorts instead.

Regards,
John Ralls



 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]