Hello daniweb members,
How can I use gtkmm with MinGW (g++) without MSYS?
Here is the story of my problem:
I installed MinGW offline with all required packages (full install).
I installed Apache Server and I copied all .tar.gz files and I created a website called sourceforge.org [localhost] and I installed automatically MinGW on Windows XP.
After, I set the PATH variables.
After, I installed gtkmm for MinGW (g++).
I tried to compile a simple window with gtkmm + MinGW, but it does not work.
I use this command line:
g++ simple.cc -o simple `pkg-config gtkmm-2.4 --cflags --libs`
After, I installed MSYS and I can compile simple.cc with MSYS, using this command line:
g++ simple.cc -o simple `pkg-config gtkmm-2.4 --cflags --libs`
My problem:
I want to compile simple.cc without MSYS. I want compile my simple.cc with cmd.exe - It's possbile? If, yes. How?
Thank you for reading my message.
Any help is appreciated.
Just replace `pkg-config gtkmm-2.4 --cflags --libs` with its output manually.
Aranarth, thank you for help. This is my problem. I don't know to replace it. How can I replace `pkg-config gtkmm-2.4 --cflags --libs` with its output manually?
Just run the command "pkg-config gtkmm-2.4 --cflags --libs" yourself. It will generate an output such as this:
-D_REENTRANT -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/atkmm-1.6 -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-x11-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
Then replace `pkg-config gtkmm-2.4 --cflags --libs` with that output. That's exactly what `command` does.
base.cc source code:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
return 0;
}
Command line:
pkg-config gtkmm-2.4 --cflags --libs
Result:
-mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl
Command line:
g++ base.cc -o base `pkg-config gtkmm-2.4 --cflags --libs`
Result:
g++: `pkg-config: No such file or directory
g++: gtkmm-2.4: No such file or directory
cc1plus.exe: error: unrecognized command line option "-fcflags"
cc1plus.exe: error: unrecognized command line option "-flibs`"
Command line:
g++ base.cc -o base -D_REENTRANT -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl
Result:
Many errors looks like:
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:269: error: ISO C++ forbids declar
ation of `get_icon' with no type
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Gio' has not been dec
lared
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Icon' was not declare
d in this scope
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: ISO C++ forbids declar
ation of `property_gicon' with no type
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Gio' has not been dec
lared
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Icon' was not declare
d in this scope
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: ISO C++ forbids declar
ation of `property_gicon' with no type
Command line:
g++ base.cc -o base -mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl
Result:
Many errors looks like:
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:269: error: ISO C++ forbids declar
ation of `get_icon' with no type
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Gio' has not been dec
lared
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Icon' was not declare
d in this scope
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: ISO C++ forbids declar
ation of `property_gicon' with no type
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Gio' has not been dec
lared
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Icon' was not declare
d in this scope
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
invalid
C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: ISO C++ forbids declar
ation of `property_gicon' with no type
By the way, I'm also using ``, looks like:
g++ base.cc -o base `-mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl`
if I use MSYS I can compile base.cc, but I need to compile it without MSYS.
Another information (perhaps necessary) about PATH (maybe here is the wrong):
Path 1:
=======
Variable name: path
Variable value: C:\MinGW\bin
Path 2:
=======
Variable name: PKG_CONFIG_PATH
Variable value: C:\gtkmm\lib\pkgconfig
What can I do?
Please help me to solve my problem.
I apologize for my English level (in case you did not properly understand my message).
Wants anybody to help me? I need to compile gtkmm GUI without MSYS (minimal System). I write a new message for moving my thread into top of this forum, because My thread has been moved into another page of forum and maybe never I would receive a solution from you. Please help me!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.