I found a port of libglademm, gtkmm etc. for win32 at http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ I wrote a simple program (without glademm/code generation, see attachments). Under linux a simple 'make' does the job. It works fine. But under windows 'make' gives the result you can see in make.out. Who can help? I have installed MinGW, MSYS, gtk-win32-devel-2.6.7-rc1, gtkmm-devel-2.6.1-1. P.S: I do not use autotools to keep the project clear.
#ifndef __MY_WINDOW_H
#define __MY_WINDOW_H
#include <gtkmm.h>
#include <libglademm.h>
class myWindow : public Gtk::Window
{
private:
Glib::RefPtr<Gnome::Glade::Xml> m_refGlade;
Gtk::Button* buttonexit;
public:
myWindow(GtkWindow*& cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refXml);
void onbuttonclick();
};
#endif
#include <iostream>
#include <libglademm.h>
#include <gtkmm.h>
#include "mywindow.h"
int main (int argc, char** argv)
{
Gtk::Main kit(argc, argv);
Glib::RefPtr<Gnome::Glade::Xml> refXml = Gnome::Glade::Xml::create("project1.glade");
myWindow* pwindow1 = 0;
refXml->get_widget_derived("window1", pwindow1);
// refXml->AutoConnect();
Gtk::Main::run(*pwindow1);
return 0;
}
#include "mywindow.h"
#include <iostream>
myWindow::myWindow(GtkWindow*& cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refXml)
: Gtk::Window(cobject), m_refGlade(refXml), buttonexit(0)
{
m_refGlade->get_widget("button1", buttonexit);
if (buttonexit) {
buttonexit->signal_clicked().connect( sigc::mem_fun(*this, &myWindow::onbuttonclick));
};
};
void myWindow::onbuttonclick()
{
std::cout << "Hallo" << std::endl;
};
LIBS= gtkmm-2.4 libglademm-2.4 CFLAGS=`pkg-config --cflags $(LIBS)` LDFLAGS=`pkg-config --libs $(LIBS)` CPP=g++ SRC=main.cpp mywindow.cpp BIN=programm $(BIN): $(SRC) $(CPP) $(CFLAGS) $(LDFLAGS) -o $(BIN) $(SRC)
Attachment:
make.zip
Description: Binary data