System: Windows7, 32 bit, GTK 2.24.10, mingw
I am trying to write basic helloworld.c type GTK based application. However, it doesn't run.
These are the steps which I followed.
Install MinGW.
Download GTK+ all in one bundle.
Extract content in C:\gtk folder.
Open cmd and go to C:\gtk\bin directory and run pkg-config --cflags --libs gtk+-win32-2.0
It prints list of compilation flags, and libraries to link your
project to.
Copy them and create a bath file as follows.
set VAR=FLAGS
start cmd
where VAR = GTK, and FLAGS = output of the previous command (pkg-config).
When you want to compile file use command : gcc foo.c %VAR%
D:\gtk>gcc -o project helloworld.c %GTK%
gcc: %GTK%: No such file or directory
helloworld.c:1:21: error: gtk/gtk.h: No such file or directory
helloworld.c: In function 'main':
helloworld.c:5: error: 'GtkWidget' undeclared (first use in this function)
helloworld.c:5: error: (Each undeclared identifier is reported only once
helloworld.c:5: error: for each function it appears in.)
helloworld.c:5: error: 'window' undeclared (first use in this function)
helloworld.c:9: error: 'GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
D:\gtk>gcc -Wall -g helloworld.c -o helloworld pkg-config --cflags gtk+-2.0 pkg-config --libs gtk+-2.0
gcc: pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
gcc: pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs"
batch file in D:\gtk
set GTK=-mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include/libpng14 -LC:/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
start cmd
helloworld.c
#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;
}
Reference : Installing gtk and compiling using gcc under windows?
You could try these manual steps to start with:
1) At your command prompt run the pkg-config command to get your include flags:
c:\dev\gtk224\bin\pkg-config.exe --cflags gtk+-2.0
This is my output:
-mms-bitfields -Ic:/dev/gtk224/include/gtk-2.0 -Ic:/dev/gtk224/lib/gtk-2.0/include -Ic:/dev/gtk224/include/atk-1.0 -Ic:/dev/gtk224/include/cairo -Ic:/dev/gtk224/include/gdk-pixbuf-2.0 -Ic:/dev/gtk224/include/pango-1.0 -Ic:/dev/gtk224/include/glib-2.0 -Ic:/dev/gtk224/lib/glib-2.0/include -Ic:/dev/gtk224/include -Ic:/dev/gtk224/include/freetype2 -Ic:/dev/gtk224/include/libpng14
2) set the output from (1) to a variable GTK_INCLUDES:
C:\dev\1_repo\gtk_scratch>set GTK_INCLUDES=-mms-bitfields -Ic:/dev/gtk224/include/gtk-2.0 -Ic:/dev/gtk224/lib/gtk-2.0/include -Ic:/dev/gtk224/include/atk-1.0 -Ic:/dev/gtk224/include/cairo -Ic:/dev/gtk224/include/gdk-pixbuf-2.0 -Ic:/dev/gtk224/include/pango-1.0 -Ic:/dev/gtk224/include/glib-2.0 -Ic:/dev/gtk224/lib/glib-2.0/include -Ic:/dev/gtk224/include -Ic:/dev/gtk224/include/freetype2 -Ic:/dev/gtk224/include/libpng14
(make sure you use YOUR output from step (1))
3) do the same as step 1 for the library flags:
c:\dev\gtk224\bin\pkg-config.exe --libs gtk+-2.0
This is my output:
-Lc:/dev/gtk224/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
4) set output from (3) to a variable GTK_LIBS
C:\dev\1_repo\gtk_scratch>set GTK_LIBS=-Lc:/dev/gtk224/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
(make sure you use YOUR output from step (3))
5) make sure gtk+ and MinGW are on your path:
set PATH=c:\dev\MinGW\bin\;c:\dev\gtk224\bin
(make sure you set your path to YOUR mingw and gtk directories)
6) compile:
c:\dev\MinGW\bin\gcc.exe -g helloworld.c -o helloworld %GTK_INCLUDES% %GTK_LIBS%
7) when you are able to compile OK, copy what you did in steps 2,4,5 and 6 to a batch file so can compile you app just by running the batch file.
The error is right here.
pkg-config is a utility which helps (and I strongly recommend) to determine link and lib flags. The issue you got is that gcc interprets it as a parameter if you pass them like you do - you need to exectue them in a subshell (but I have no clue how to do that under windows shell or cygwin) under bash it is either $(pkconfig --libs gtk-2.0) or with backticks around instead of $(...)
D:\gtk>gcc -Wall -g helloworld.c -o helloworld pkg-config --cflags gtk+-2.0 pkg-config --libs gtk+-2.0
gcc: pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
gcc: pkg-config: No such file or directory
gcc: gtk+-2.0: No such file or directory
cc1.exe: error: unrecognized command line option "-fcflags"
cc1.exe: error: unrecognized command line option "-flibs"
Get same error when running hello, world program. Following solution work for me.
Instead of saving your helloworld.c at any arbitrary place, put it inside of
MinGW > msys > 1.0 > home > "Name of Your home folder" > helloworld.c
Now, open msys.bat and write the command to run program. In my case it was:
gcc hello.c -o hello `pkg-config --cflags --libs gtk+-3.0`
And it works for me!
Related
I'm a beginning C++ programmer and want to use Code::Blocks IDE on Debian based Linux to write some GUI programs.
Therefore I would like to use gtkmm 3.0 with this code:
#include <gtkmm/gtkmm.h>
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base");
Gtk::Window window;
window.set_default_size(200, 200);
return app->run(window);
}
The compiler gives me this error:
fatal error: gtkmm/gtkmm.h: No such file or directory
I followed these steps to install gtkmm:
Installed Code::Blocks and was able to compile non-GUI programs.
Then installed gtkmm-3.0 with synaptic.
In Code::Blocks settings > compiler > compiler settings > other compiler options I set:
pkg-config --cflags gtk+-3.0
In codeblock settings > compiler> linker settings > other linker settings I set:
pkg-config --libs gtk+-3.0
When compiling I got the next error in Build log:
Build file: "no target" in "no project" (compiler: unknown)
[ 50.0%] g++ -std=c++14 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c /home/meltdown/Documents/C++/GTKmm2019C/t1/t1.cpp -o /home/meltdown/Documents/C++/GTKmm2019C/t1/t1.o
[100.0%] g++ -o /home/meltdown/Documents/C++/GTKmm2019C/t1/t1 /home/meltdown/Documents/C++/GTKmm2019C/t1/t1.o -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
/home/meltdown/Documents/C++/GTKmm2019C/t1/t1.cpp:2:10: fatal error: gtkmm/gtkmm.h: No such file or directory
2 | #include <gtkmm/gtkmm.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I use a single .cpp file, not a Gtk+ project.
I've tried this and this but no luck. Does anyone know how to set up Code::Blocks and its compiler properly for gtkmm?
You've asked the IDE to search include directories for the GTK+ package with the command:
`pkg-config --cflags gtk+-3.0`
However, your program uses gtkmm, which is a layer on top of GTK+. You want to broaden the search to encompass the directories for gtkmm:
`pkg-config --cflags gtkmm-3.0`
(This replaces the current entry in the "other compiler options".) Similarly, you'll need to change, under "other linker settings", the library paths to:
`pkg-config --libs gtkmm-3.0`
Net-beans : 8.2
Windows : 10 64-bit
MinGW-w64 g++ : 7.2
I am trying to create an empty window using gtkmm 3.0 referring Programming with gtkmm book. I am referring (3.1) Simple Example from Chapter 3. Basics
#include <gtkmm.h>
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base");
Gtk::Window window;
window.set_default_size(200, 200);
return app->run(window);
}
I have tried both
#include <gtkmm-3.0/gtkmm.h>
#include <gtkmm.h>
but my build fails under both circumstances.
g++ -c -g `pkg-config --cflags gtkmm-3.0` -std=c++14 -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
Package gtkmm-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkmm-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkmm-3.0' found
main.cpp:14:10: fatal error: gtkmm.h: No such file or directory
#include <gtkmm.h>
^~~~~~~~~
compilation terminated.
make[2]: *** [nbproject/Makefile-Debug.mk:68: build/Debug/MinGW-Windows/main.o] Error 1
make[2]: Leaving directory '/e/Projects/DiaplayL'
make[1]: *** [nbproject/Makefile-Debug.mk:59: .build-conf] Error 2
make[1]: Leaving directory '/e/Projects/DiaplayL'
make: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
I have installed msys2 in E drive. I was unable to install msys2 in C drive as the installation gets stuck at 0%.
I have added PKG_CONFIG_PATH :- E:\msys64\mingw64\bin in my environment variables. I am able look at include directories using --cflags and linked libraries using --libs
E:\Projects\DemoLcd>pkg-config --cflags gtkmm-3.0
-mms-bitfields -pthread -mms-bitfields -IE:/msys64/mingw64/include/gtkmm-3.0 -IE:/msys64/mingw64/lib/gtkmm-3.0/include -IE:/msys64/mingw64/include/atkmm-1.6 -IE:/msys64/mingw64/include/gdkmm-3.0 -IE:/msys64/mingw64/lib/gdkmm-3.0/include -IE:/msys64/mingw64/include/giomm-2.4 -IE:/msys64/mingw64/lib/giomm-2.4/include -IE:/msys64/mingw64/include/pangomm-1.4 -IE:/msys64/mingw64/lib/pangomm-1.4/include -IE:/msys64/mingw64/include/glibmm-2.4 -IE:/msys64/mingw64/lib/glibmm-2.4/include -IE:/msys64/mingw64/include/gtk-3.0 -IE:/msys64/mingw64/include/cairo -IE:/msys64/mingw64/include -IE:/msys64/mingw64/include/pango-1.0 -IE:/msys64/mingw64/include/atk-1.0 -IE:/msys64/mingw64/include/cairo -IE:/msys64/mingw64/include/cairomm-1.0 -IE:/msys64/mingw64/lib/cairomm-1.0/include -IE:/msys64/mingw64/include/cairo -IE:/msys64/mingw64/include/pixman-1 -IE:/msys64/mingw64/include -IE:/msys64/mingw64/include/freetype2 -IE:/msys64/mingw64/include/libpng16 -IE:/msys64/mingw64/include/harfbuzz -IE:/msys64/mingw64/include/glib-2.0 -IE:/msys64/mingw64/lib/glib-2.0/include -IE:/msys64/mingw64/include -IE:/msys64/mingw64/include/freetype2 -IE:/msys64/mingw64/include -IE:/msys64/mingw64/include/harfbuzz -IE:/msys64/mingw64/include/libpng16 -IE:/msys64/mingw64/include/sigc++-2.0 -IE:/msys64/mingw64/lib/sigc++-2.0/include -IE:/msys64/mingw64/include/gdk-pixbuf-2.0 -IE:/msys64/mingw64/include/libpng16 -IE:/msys64/mingw64/include -IE:/msys64/mingw64/include/glib-2.0 -IE:/msys64/mingw64/lib/glib-2.0/include -IE:/msys64/mingw64/include
E:\Projects\DemoLcd>pkg-config --libs gtkmm-3.0
-LE:/msys64/mingw64/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lz -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
I am facing the same problem in other machine where msys2 is installed in C drive and installed without a hitch.
Kindly advice.
Solution is in 2 steps :
Modify $PKG_CONFIG_PATH in Msys2 shell to include the pkg_config folder containing .pc files for respective packages. eg: export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/mingw64/lib/pkgconfig or add the above command in /home//.bashrc
Create PKG_CONFIG_PATH environment variable with value as the Linux-type path i.e. /mingw64/lib/pkgconfig of the pkg_config folder containing .pc files for respective packages. e.g.: PKG_CONFIG_PATH = /mingw64/lib/pkgconfig
I'm trying to install a C++ library (gtkmm) for my project and to test this installation with a simple test file (the main from wikipedia page about gtkmm).
I did brew install gtkmm3, it installed it but when I compile with clang++ -Wall -Werror -Wextra -o test test.cpp it doesn't find my header :
test.cpp:15:10: fatal error: 'gtkmm-3.0/gtkmm.h' file not found
#include <gtkmm-3.0/gtkmm.h>
The header is located at ~/homebrew/include/gtkmm-3.0/gtkmm.h.
I tried :
adding $HOME"/homebrew/include" to $PATH and using #include <gtkmm-3.0/gtkmm.h> in my source file.
adding $HOME"/homebrew/include/gtkmm-3.0" to my $PATH and using #include <gtkmm.h> in my source file.
But I still can't compile.
How could I do?
Yes, use pkgconfig like this and it will tell you all the include paths and the link paths you need:
pkg-config --libs --cflags /usr/local/Cellar/gtkmm3/*/lib/pkgconfig/gdkmm-3.0.pc
Output
-D_REENTRANT -I/usr/local/Cellar/gtkmm3/3.18.0/include/gdkmm-3.0
-I/usr/local/Cellar/gtkmm3/3.18.0/lib/gdkmm-3.0/include
-I/usr/local/Cellar/glibmm/2.46.3/include/giomm-2.4
-I/usr/local/Cellar/glibmm/2.46.3/lib/giomm-2.4/include
-I/usr/local/Cellar/pangomm/2.38.1/include/pangomm-1.4
-I/usr/local/Cellar/pangomm/2.38.1/lib/pangomm-1.4/include
-I/usr/local/Cellar/glibmm/2.46.3/include/glibmm-2.4
-I/usr/local/Cellar/glibmm/2.46.3/lib/glibmm-2.4/include
-I/usr/local/Cellar/gtk+3/3.18.6/include/gtk-3.0
-I/usr/local/Cellar/glib/2.46.2/include/gio-unix-2.0/
-I/usr/local/Cellar/cairo/1.14.6/include/cairo
-I/usr/local/Cellar/libepoxy/1.3.1/include
-I/usr/local/Cellar/pango/1.38.1/include/pango-1.0
-I/usr/local/Cellar/harfbuzz/1.1.3/include/harfbuzz
-I/usr/local/Cellar/pango/1.38.1/include/pango-1.0
-I/usr/local/Cellar/atk/2.18.0/include/atk-1.0
-I/usr/local/Cellar/cairo/1.14.6/include/cairo
-I/usr/local/Cellar/cairomm/1.12.0/include/cairomm-1.0
-I/usr/local/Cellar/cairomm/1.12.0/lib/cairomm-1.0/include
-I/usr/local/Cellar/cairo/1.14.6/include/cairo
-I/usr/local/Cellar/pixman/0.32.8/include/pixman-1
-I/usr/local/Cellar/fontconfig/2.11.1/include
-I/usr/local/Cellar/freetype/2.6_1/include/freetype2
-I/usr/local/Cellar/libpng/1.6.20/include/libpng16
-I/usr/local/Cellar/libsigc++/2.6.2/include/sigc++-2.0
-I/usr/local/Cellar/libsigc++/2.6.2/lib/sigc++-2.0/include
-I/usr/local/Cellar/gdk-pixbuf/2.32.3/include/gdk-pixbuf-2.0
-I/usr/local/Cellar/libpng/1.6.20/include/libpng16
-I/usr/local/Cellar/glib/2.46.2/include/glib-2.0
-I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include
-I/usr/local/opt/gettext/include
-L/usr/local/Cellar/gtkmm3/3.18.0/lib
-L/usr/local/Cellar/glibmm/2.46.3/lib
-L/usr/local/Cellar/pangomm/2.38.1/lib
-L/usr/local/Cellar/glibmm/2.46.3/lib
-L/usr/local/Cellar/gtk+3/3.18.6/lib
-L/usr/local/Cellar/pango/1.38.1/lib
-L/usr/local/Cellar/atk/2.18.0/lib
-L/usr/local/Cellar/cairo/1.14.6/lib
-L/usr/local/Cellar/glib/2.46.2/lib
-L/usr/local/Cellar/cairomm/1.12.0/lib
-L/usr/local/Cellar/cairo/1.14.6/lib
-L/usr/local/Cellar/libsigc++/2.6.2/lib
-L/usr/local/Cellar/gdk-pixbuf/2.32.3/lib
-L/usr/local/Cellar/glib/2.46.2/lib
-L/usr/local/opt/gettext/lib
-lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
Then you can compile with:
clang++ $(pkg-config --libs --cflags /usr/local/Cellar/gtkmm3/*/lib/pkgconfig/gdkmm-3.0.pc) someFile.cpp -o someFile
The context is the following: I am trying to compile InkscapeLite from sources in Linux Mint. At the end of the compilation, the last command is (some .o and .a files are replaced with "...", because the command is very long):
gcc -g -O2 -o inkscape --export-dynamic inkscape.o inkscape-stock.o ... ./.libs/libinkscape.al dialogs/libspdialogs.a ... -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/i386-linux-gnu/libcairo.so -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 /usr/lib/i386-linux-gnu/libart_lgpl_2.so /usr/lib/i386-linux-gnu/libxml2.so /usr/lib/i386-linux-gnu/libpopt.so -lpng -lXft -L/usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu/libfreetype.so -lz -Wl,--rpath -Wl,/usr/lib/i386-linux-gnu -Wl,--rpath -Wl,/usr/lib/i386-linux-gnu
It fails with error: gcc: error: unrecognized option '--export-dynamic'
What I have done is to replace --export-dynamic with -export-dynamic, just for test (notice, I am not C/C++ programmer and know nothing about GCC or any other C compiler) and executed the command manually in the console. The compilation ended without errors and the program works, but it misses almost all toolbar and menu icons (only some common icons are there as open/save/copy/paste...)
Is it because of this problem option --export-dynamic or there is some different problem in the sources?
BTW, the same program works normally in the Puppy Linux distributions.
It seems the building scripts issue. --export-dynamic is a linker (ld in Unixes) option which could be useful in your case but it isn't gcc frontend option. All GCC versions I see have -rdynamic flag which causes passing of --export-dynamic to linker. So you can fix this with your own means (e.g. simply try to rename the option in makefile/etc.) and/or report the issue to maintainers.
Use gcc -rdynamic or -Wl,--export-dynamic (the -Wl tells to send the next suboption to ld ...)
OS: Windows 7
Compiler: MinGW
IDE: Code::Blocks
I just installed Gtkmm on my computer in the folder C:/gtkmm/ and set up an example program. When I compiled it, it gave the error "gtkmm.h: No such file or directory"
I tried setting the PATH variable to C:/gtkmm/include and C:/gtkmm/gtkmm-2.4, but neither worked. Then I tried using #include "C:/gtkmm/include/gtkmm-2.4/gtkmm.h" and that just gave a ton of errors saying that it doesn't know where a few dozen files are.
I've also heard that you need to put pkg-config gtkmm-2.4 --cflags --libs in the compiler options, but that didn't work either.
What am I doing wrong and how do I fix it?
pkg-config is a helper function for adding cflags and lib paths to the compiler line.
What you will need to do is add the libraries and cflags path to the compiler line. I am not 100% sure how to do that in code::blocks., though
In ubuntu 11.04, you need all these to compile even a simple gtkmm program:
Libs (pkg-config --libs gtkmm-2.4:
-pthread -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 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
cflags paths (pkg-config --clfags gtkmm-2.4):
-I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gio-unix-2.0/ -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/atkmm-1.6 -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/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/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/lib/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0
Basically you would have to change every instance of /usr/include/ and /usr/lib/ to c:\path-to-library\
I am not sure how much of the above you need with MinGW, but with GCC on Linux, dropping any of them makes gtkmm programs not compile. Hope that at least puts you on the right path.
What do you mean with PATH variable? The global windows search PATH for executables? That would be wrong.
You need to look in your IDE for Include search path or header search path or something like that.
Does that pkg-config command work for you when you execute it on the command line? Such a pkg-config when used on a unix system is enclosed in backticks ` which causes it to be substituted by it's output. Don't know if your IDE can do that but if it works from the command line you have at least a list of all includes needed.
Use autotools C++ project. You need only edit two files configure.ac and Makefile.am.
Add this line to configure.ac
PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0])
and these lines to Makefile.am
program_CPPFLAGS = $(GTKMM_CFLAGS)
program_LDADD = $(GTKMM_LIBS)