I'm trying to compile a gtk program on PowerShell so that I can use pkg-config's output as input to gcc but gcc is taking the whole output as a single command line option and return the error:
gcc.exe: error: unrecognized command line option '-mms-bitfields -pthread -mms-bitfields -IC:/gtk/include/gtk-3.0 -IC tk/include/cairo -IC:/gtk/include -IC:/gtk/include/pango-1.0 -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk clude/pixman-1 -IC:/gtk/include -IC:/msys/opt/include -IC:/msys/opt/include/freetype2 -IC:/msys/opt/include -IC:/msys t/include/libpng16 -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng16 -IC:/gtk/in de/gdk-pixbuf-2.0 -IC:/gtk/include/libpng16 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgt -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lz -lpangowin32-1.0 -lp ocairo-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'
the command line I'm using:
gcc hello.c -o hello $(pkg-config.exe --cflags --libs gtk+-3.0)
I've also tried:
$(gcc hello.c -o hello $(pkg-config.exe --cflags --libs gtk+-3.0))
either return same result. How do I fix this?
gcc hello.c -o hello '--%' $(pkg-config.exe --cflags --libs gtk+-3.0)
– user4003407