Problem description:
I am using windows-10 OS and from the cmd window I can use gcc compiler:
gcc --version
returns:
gcc (Rev2, Built by MSYS2 project) 9.2.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I want to use GTK+ for creating GUIs and therefore installed GTK+ library using MSYS2. When compiling a small program I need to use pkg-config
in back quotes symbols:
gcc -o first_test ../gd_src/first_test.c `pkg-config --libs --cflags gtk+-3.0`
Problem:
The gcc
compiler throws the following error:
gcc: error: `pkg-config: No such file or directory gcc: error: gtk+-3.0`: No such file or directory gcc: error: unrecognized command line option '--libs' gcc: error: unrecognized command line option '--cflags'
However, just typing:
pkg-config --libs --cflags gtk+-3.0
returns:
-pthread -mms-bitfields -IC:/msys64/mingw64/include/gtk-3.0 -IC:/msys64/mingw64/include/cairo -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/pango-1.0 -IC:/msys64/mingw64/include/fribidi -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/atk-1.0 -IC:/msys64/mingw64/include/cairo -IC:/msys64/mingw64/include/pixman-1 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/freetype2 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/include/harfbuzz -IC:/msys64/mingw64/include/libpng16 -IC:/msys64/mingw64/include/gdk-pixbuf-2.0 -IC:/msys64/mingw64/include -IC:/msys64/mingw64/lib/libffi-3.2.1/include -IC:/msys64/mingw64/include/glib-2.0 -IC:/msys64/mingw64/lib/glib-2.0/include -IC:/msys64/mingw64/include -LC:/msys64/mingw64/lib -lgtk-3 -lgdk-3 -lz -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lpangowin32-1.0 -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 -lintl
I should also point out that using MSYS2 provided cmd window (I do not know how to call it, bash ... ?) there is no such problem.
My opinion
I guess is some kind of problem with backquote in the cmd window for Windows 10 ?! How can I solve this?
update
Running just
gcc -o first_test ../gd_src/first_test.c pkg-config --libs --cflags gtk+-3.0
gives
gcc: error: pkg-config: No such file or directory gcc: error: gtk+-3.0: No such file or directory gcc: error: unrecognized command line option '--libs' gcc: error: unrecognized command line option '--cflags'