新建一个工程,
其产生的代码如下(我没有贴注释)
代码: 全选
#include <libglademm/xml.h>
#include <gtkmm.h>
#include <iostream>
/* For testing propose use the local (not installed) glade file */
/* #define GLADE_FILE PACKAGE_DATA_DIR"/gtk-foobar2/glade/gtk-foobar2.glade" */
#define GLADE_FILE "gtk-foobar2.glade"
int
main (int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
//Load the Glade file and instiate its widgets:
Glib::RefPtr<Gnome::Glade::Xml> refXml;
try
{
refXml = Gnome::Glade::Xml::create(GLADE_FILE);
}
catch(const Gnome::Glade::XmlError& ex)
{
std::cerr << ex.what() << std::endl;
return 1;
}
Gtk::Window* main_win = 0;
refXml->get_widget("main_window", main_win);
if (main_win)
{
kit.run(*main_win);
}
return 0;
}
我用$sudo find -name xml.h 都没有找到该文件,困惑ing