jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
121 stars 22 forks source link

Building fails (Linux x32) #124

Closed ruvater closed 9 years ago

ruvater commented 9 years ago

It's kinda obvious what to do with the first error, but I haven't got a clue about the others.

$ cargo run
    Updating git repository `https://github.com/jeremyletang/rgtk.git`
   Compiling rgtk v0.0.1 (https://github.com/jeremyletang/rgtk.git#855af3f4)
src/gtk/widgets/treepath.rs:54:87: 54:107 error: mismatched types: expected `u32`, found `u64` (expected u32, found u64)
src/gtk/widgets/treepath.rs:54         let tmp = unsafe { ffi::gtk_tree_path_new_from_indicesv(indices.as_mut_ptr(), indices.len() as u64) };
                                                                                                                     ^~~~~~~~~~~~~~~~~~~~
src/gtk/widgets/popover.rs:55:75: 55:98 error: mismatched types: expected `gtk::enums::position_type::PositionType`, found `i32` (expected enum gtk::enums::position_type::PositionType, found i32)
src/gtk/widgets/popover.rs:55         unsafe { ffi::gtk_popover_set_position(GTK_POPOVER(self.pointer), ffi::to_gboolean(modal)) }
                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~
src/gtk/widgets/popover.rs:59:31: 59:87 error: mismatched types: expected `i32`, found `gtk::enums::position_type::PositionType` (expected i32, found enum gtk::enums::position_type::PositionType)
src/gtk/widgets/popover.rs:59         unsafe { ffi::to_bool(ffi::gtk_popover_get_position(GTK_POPOVER(self.pointer))) }
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
Could not compile `rgtk`.

To learn more, run the command again with --verbose.
$ rustc -v
rustc 0.13.0-nightly (aff4f11cd 2014-10-19 23:32:07 +0000)
GuillaumeGomez commented 9 years ago

Don't worry, it's "normal". The #123 PR will fix this when @jeremyletang will merge it.

GuillaumeGomez commented 9 years ago

Actually that's not the same errors, @jeremyletang has fixed them. It will create a PR for it.

jeremyletang commented 9 years ago

hey @ruvater, can you try to with the last commit ? The problem should be fix now.

ruvater commented 9 years ago

@jeremyletang so... those errors was fixed, but unfortunately there are fresh ones:

bob@bob-laptop:~/Programming/calc$ cargo run
   Compiling rgtk v0.0.1 (https://github.com/jeremyletang/rgtk.git#9f1d1550)
src/gtk/widgets/value.rs:110:54: 110:60 error: mismatched types: expected `i32`, found `i64` (expected i32, found i64)
src/gtk/widgets/value.rs:110         unsafe { ffi::g_value_set_long(self.pointer, v_long) }
                                                                                  ^~~~~~
src/gtk/widgets/value.rs:114:18: 114:53 error: mismatched types: expected `i64`, found `i32` (expected i64, found i32)
src/gtk/widgets/value.rs:114         unsafe { ffi::g_value_get_long(self.pointer) }
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/gtk/widgets/value.rs:118:55: 118:62 error: mismatched types: expected `u32`, found `u64` (expected u32, found u64)
src/gtk/widgets/value.rs:118         unsafe { ffi::g_value_set_ulong(self.pointer, v_ulong) }
                                                                                   ^~~~~~~
src/gtk/widgets/value.rs:122:18: 122:54 error: mismatched types: expected `u64`, found `u32` (expected u64, found u32)
src/gtk/widgets/value.rs:122         unsafe { ffi::g_value_get_ulong(self.pointer) }

I'm not that good at Rust, but I could try to fix it tonight.

jeremyletang commented 9 years ago

hey @ruvater,

This have probably been introduced by the PR from @GuillaumeGomez. The last commit should fix this. Tell me if you have more bug like this, @GuillaumeGomez and me both work on 64bit computer, so we may have some "cast" problem for long value.

ruvater commented 9 years ago

@jeremyletang

Great, guys. Thanks! It works fine now.