Home > database >  gtkmm on windows; "pkg-config gtkmm-4.0 --cflags --libs" get the paths but => fatal err
gtkmm on windows; "pkg-config gtkmm-4.0 --cflags --libs" get the paths but => fatal err

Time:04-20

to manually compile I use at the moment the Windows Power shell. The pahts are right, I think:

pkg-config gtkmm-4.0 --cflags --libs

-IC:/msys64/mingw64/bin/../include/gtkmm-4.0 -IC:/msys64/mingw64/bin/../lib/gtkmm-4.0/include -IC:/msys64/mingw64/bin/../include/giomm-2.68 -IC:/msys64/mingw64/bin/../lib/giomm-2.68/include -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -IC:/msys64/mingw64/bin/../include/glibmm-2.68 -IC:/msys64/mingw64/bin/../lib/glibmm-2.68/include -IC:/msys64/mingw64/bin/../include/sigc  -3.0 -IC:/msys64/mingw64/bin/../lib/sigc  -3.0/include -IC:/msys64/mingw64/bin/../include/gtk-4.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -IC:/msys64/mingw64/bin/../include/graphene-1.0 -IC:/msys64/mingw64/bin/../lib/graphene-1.0/include -mfpmath=sse -msse -msse2 -IC:/msys64/mingw64/bin/../include/cairomm-1.16 -IC:/msys64/mingw64/bin/../lib/cairomm-1.16/include -IC:/msys64/mingw64/bin/../include/pangomm-2.48 -IC:/msys64/mingw64/bin/../lib/pangomm-2.48/include -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtkmm-4.0 -lgtk-4 -lpangowin32-1.0 -lcairo-gobject -lgraphene-1.0 -lpangomm-2.48 -lgiomm-2.68 -lgio-2.0 -lglibmm-2.68 -lcairomm-1.16 -lsigc-3.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
PS 

C:\msys64\mingw64\include\gtkmm-4.0> ls

    Directorio: C:\msys64\mingw64\include\gtkmm-4.0

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        29/03/2022     18:21                gdkmm
d-----        29/03/2022     18:21                gtkmm
-a----        22/03/2022     10:36           1914 gdkmm.h
-a----        22/03/2022     10:36          10091 gtkmm.h

But when I try tho compile the example program, I get the next error:

 C:\Programacion\gtk\cmake_test> g   $(pkg-config gtkmm-4.0 --cflags --libs) base.cc -o simple
base.cc:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.

It's like g doesn't have access to paths.

What could I do to fix it?

Thanks in advance

CodePudding user response:

SOLVED: The powershell doesn't concatenate the commands in unix style, so g doesn't work together with $(pkg-config gtkmm-4.0 --cflags --libs)

It works through the msys2-mingw x64 shell, but the right command is.

g   base.cc -o base $(pkg-config gtkmm-4.0 --cflags --libs)

now should it works together with CMake, but that is another story...

  • Related