我在Mac上使用gtkmm3。我可以构建一些简单的程序,但是不能使用Gtk::Builder
。该如何解决?
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base");
Glib::RefPtr<Gtk::Builder> builder;
try {
builder = Gtk::Builder::create_from_file("OPPDemo_GUI.glade");
} catch (Gtk::BuilderError& e){
std::cout<<e.what();
}
x86_64体系结构的未定义符号:
“Gtk::Builder::create_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
”,已引用 从: 引用于OPPDemo_GUI.cpp.o“Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
”中的_main,引用自: OPPDemo_GUI.cpp.o中的on_click() OPPDemo_GUI.cpp.o“Glib::ustring::ustring(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
”中的on_click()[clone .cold.383]引用 从: OPPDemo_GUI.cpp.o中的on_click() 引用于OPPDemo_GUI.cpp.o“Glib::operator<<(std::basic_ostream<char, std::char_traits<char> >&, Glib::ustring const&)
”中的_main,引用自: ____cold_sect_of__main in OPPDemo_GUI.cpp.o ld:找不到体系结构x86_64 collect2的符号:错误:ld返回1退出 状态标记[3]: * [Operator_Precedence_Parser / Demo / OPPDemo_GUI] 错误1 make [2]: [Operator_Precedence_Parser / Demo / CMakeFiles / OPPDemo_GUI.dir / all]错误 2名[1]: [Operator_Precedence_Parser / Demo / CMakeFiles / OPPDemo_GUI.dir / rule] 错误2:* [OPPDemo_GUI]错误2