''' extern crate gtk; use gtk::prelude::*; use gtk::{Button, Window, WindowType}; fn main() { if gtk::init().is_err() { println!("Failed to initialize GTK."); return; } let window = Window::new(WindowType::Toplevel); window.set_title("First GTK+ Program"); window.set_default_size(350, 70); let button = Button::new_with_label("Click me!"); window.add(&button); window.show_all(); window.connect_delete_event(|_, _| { gtk::main_quit(); Inhibit(false) }); button.connect_clicked(|_| { println!("Clicked!"); }); gtk::main(); } **(.:15872): Gtk-ERROR : 15:43:06.203: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported '''
请问各位大佬这个问题怎么解决呢?QAQ
评论区
写评论haha,搞定了,不能在sublime text运行,在终端里运行就没问题,谢谢你啦。
指定版本号呢? https://gtk-rs.org/tuto/version
还是不行。会不会因为我linux上同时装了gtk2和gtk3。我想卸载一个,但是两个都有很多依赖,就没卸载。
cargo clean试试?