Reputation: 1026
I have Fedora (latest) installed as well as mingw32 and gtk packages.
I wrote simple Hello world:
#include <gtk/gtk.h>
int main(int argc, char* argv[]){
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
I can easily compile it under Fedora with:
gcc -o hello hello.c 'pkg-config --libs --cflags gtkmm-3.0'
(wrong apostrophes here)
I also tried to compile simple printf("Hello world");
program (without gtk) for windows with: i686-pg-mingw32-gcc simple.c -o simple.exe
and it worked perfectly under Windows
But what I can´t is cross-compile for windows using GTKmm (even example with another version of GTK would be great). I read this http://camltastic.blogspot.com/2008/10/mingw-compile-software-for-windows.html but it uses configure and make which I don´t have for my programs.
Also there´s a lot there: http://ricardo.ecn.wfu.edu/~cottrell/cross-gtk/ but it talks about installing mingw yourself to custom folder and so... but I have installed mingw using Fedora yum.
Update after all rodrigo's tips:
YES! We got it! It's working. It's starting console first but nevermind. I also haven't tested all GTK libraries, but I think they should work as well.
After year of trying I finally have it and I am closest to developing GUI apps ever I've ever been. So thank you a lot for your patience and guidance. I think that now I also somehow understood how this all works (I mean, compiled libs for different OS, pkg-config, passing variables etc.)
Upvotes: 2
Views: 2386
Reputation: 98446
You have installed mingw from the Fedora repositories, but you still need the GTK libraries compiled for Windows. You can compile them yourself (not trivial, but not terribly difficult either) or you can download them elsewhere, as the page you cite suggests.
UPDATE: About your tries in the comments below:
I fixed pc files I copied into /usr/lib/pkgconfig and here is my log: pastebin.com/KZr8tMQ0 I really don't understand. When I run pkg-config it's missing gobject. When I run it as root it's missing gdk. When I run it with gtkmm-3.0 it generates parameters...when I run it with gtkmm-2.4 it crash even if gtkmm-2.4 is actualy the only gtkmm pc file I have in folder set in PKG_CONFIG_PATH.
pkg-config gtkmm-2.4
.sudo pkg-config
is ignoring your Windows installation.lib/pkgconfig
directory.Upvotes: 1