Open ErinCall opened 9 years ago
_gtk_range_set_value
, _gtk_adjustment_new
, _gtk_hscale_new
, sounds like you need to install GTK+. Sorry, I forgot to add that to the install instructions for OS X. It can be version 2.x or 3.x, IUP can work with both.
I'd really like to see IUP run directly on top of Cocoa but no one has been working on the driver for it.
I'm wrestling with that now. I've installed it with Homebrew but can't figure out how to point gcc at it--I'm guessing it's something like INCLUDE_PATH=/usr/local/Cellar/.... cargo build
, but I'm not sure what the exact env var is, or what directory level to point it at. Do you know those?
Does this StackOverflow answer help?
It doesn't seem to. PKG_CONFIG_PATH=/usr/local/Cellar/gtk+/2.24.28/lib/pkgconfig/ LDFLAGS=-L/usr/local/Cellar/gtk+/2.24.28/lib/ CPPFLAGS=-I /usr/local/Cellar/gtk+/2.24.28/lib/ cargo build
gives the same error.
It seems like it's weird that it's saying "undefined symbols" rather than something about failing to find a .h
or .o/.so/.dylib
file. Is that weird or is that a normal dynamic-linking problem?
Hmm... maybe try installing GTK+3? It might be looking for symbols that are not in 2.x, although I could have sworn it could link with either.
No love, but I'm noticing the cc
command in the error output doesn't list the gtk paths I'm putting in PKG_CONFIG_PATH
/LDFLAGS
/CPPFLAGS
. Should I be looking at how to specify them in Cargo.toml
?
It's trying to static-link to GTK+ because it's static-linking to IUP. Did you install IUP with ./install
(dynamic) or ./install_dev
(static)? It might work better with dynamic linking because IUP will find it at runtime.
Both. I think I did install_dev
first, then tried install
when I had trouble
All right, maybe try uninstalling and then just doing install
.
Ok, that gives me ld: library not found for -liup
which is at least a different error. Thanks for your fast responses on this :) I'm gonna take a break from bashing my face against it, and try to resolve the ld error later.
Progress! Don't get discouraged, link errors are always a pain to deal with. You should have seen me try to set up this crap on Windows so I could write the install instructions for it.
I got it! The steps that got things working for me were:
sudo ./install_dev
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig/ pkg-config --libs x11 gtk+-2.0
So my working build.rs
looks like so:
fn main() {
// here is gtk
println!("cargo:rustc-link-search=native=/usr/local/Cellar/gtk+/2.24.28/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/pango/1.36.8/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/atk/2.16.0/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/cairo/1.14.2/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/gdk-pixbuf/2.30.8/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/glib/2.44.1/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/pango/1.36.8/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/glib/2.44.1/lib");
println!("cargo:rustc-link-search=native=/usr/local/opt/gettext/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/fontconfig/2.11.1/lib");
println!("cargo:rustc-link-search=native=/usr/local/Cellar/freetype/2.5.5/lib");
println!("cargo:rustc-link-lib=dylib=gtk-x11-2.0");
println!("cargo:rustc-link-lib=dylib=gdk-x11-2.0");
println!("cargo:rustc-link-lib=dylib=pangocairo-1.0");
println!("cargo:rustc-link-lib=dylib=atk-1.0");
println!("cargo:rustc-link-lib=dylib=cairo");
println!("cargo:rustc-link-lib=dylib=gdk_pixbuf-2.0");
println!("cargo:rustc-link-lib=dylib=gio-2.0");
println!("cargo:rustc-link-lib=dylib=pangoft2-1.0");
println!("cargo:rustc-link-lib=dylib=pango-1.0");
println!("cargo:rustc-link-lib=dylib=gobject-2.0");
println!("cargo:rustc-link-lib=dylib=glib-2.0");
println!("cargo:rustc-link-lib=dylib=intl");
println!("cargo:rustc-link-lib=dylib=fontconfig");
println!("cargo:rustc-link-lib=dylib=freetype");
// here is X11/xquartz
println!("cargo:rustc-link-search=native=/opt/X11/lib");
println!("cargo:rustc-link-lib=dylib=X11");
}
Oh, wow. Perhaps the pkg-config
crate can streamline this process on platforms where it is available.
I haven't messed with C libraries much so I'm not sure if this is a problem with kiss-ui, IUP, my system, or me, but I'm getting a build error that I'm not sure how to resolve.
full, un-snipped error
This is on OSX 10.10.3 after installing IUP using the "precompiled binary" instructions in the README. I'm using
cargo 0.4.0-nightly (b48cd46 2015-07-01) (built 2015-07-01)
andrustc 1.0.0 (built 2015-05-16)
I'd appreciate any help you can offer!