ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have created a basic gtk+ gui in glade-2, using c++ output. I can compile it using the autogen.sh and make, but I would like to compile it to and windows binary. I'm running debian.
I have installed the mingw32 compiler, and I have compiled console windows binaries with it.
Can one change the compiler make uses, to the mingw32 compiler? Is the mingw32 compiler a good choice for this?
Sorry,
my Makefile was only a vary simple example. I have used to build my application.
I don't use automake (i am not very into m4)
I haven't a working windows installation now but ...
try to define in the makefile:
SRCS = project4.cc window1.cc window1_glade.cc
MDEPS= window1.hh window1_glade.hh
MYCFLAGS= -g -I. $(shell pkg-config --cflags gtkmm-2.4 )
MYLDFLAGS=$(shell pkg-config --libs gtkmm-2.4)
mytest.exe: $(SRCS) $(MDEPS)
$(CC) $(MYCFLAGS) -mwindows -mms-bitfields $(SRCS) -o mytest $(MYLDFLAGS)
keep attention, the last line must have a tab as first character.
replace gtkmm-2.4 with the version you are using
the command pkg-config looks for files in the pkgconfig directory for compiler and linker options
Maybe you need also libglade and libglademm
It starts to compile, and gives the following output. I think it is a minor problem, I'll probably be able to figger it out (I used your Makefile exactly, so I probibly just need to change something)
Thanx again!
output:
/usr/bin/i586-mingw32msvc-g++ -g -I. -DXTHREADS -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/X11R6/include -I/usr/include/atk-1.0 -mwindows -mms-bitfields project4.cc window1.cc window1_glade.cc -o mytest -L/usr/X11R6/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-x11-2.0 -lpangomm-1.4 -lglibmm-2.4 -lsigc-2.0 -lgdk-x11-2.0 -lXrandr -lXi -lXinerama -lXext -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXcursor -lpango-1.0 -lcairo -lXrender -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
project4.cc:8:20: config.h: No such file or directory
In file included from project4.cc:10:
/usr/include/glib-2.0/glib/gi18n.h:23:21: libintl.h: No such file or directory
window1.cc:8:20: config.h: No such file or directory
window1_glade.cc:15:20: config.h: No such file or directory
make: *** [mytest.exe] Error 1
colinux:/mnt/fullshare/c/project4/src# ls
Makefile Makefile.am Makefile.in project4.cc window1.cc window1.hh window1_glade.cc window1_glade.hh
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.