I installed msys2 and mingw64 and mingw64-GTK3 in D:\Program Files\msys which has space in it's path.
After installing mingw-w64-x86_64-gtk3 ,mingw-w64-x86_64-make, mingw-w64-x86_64-gcc packages for gtk programming I wanted to compile main.c but
it throw this error:
$ g++ main.c -o myapp_output `pkg-config --cflags --libs gtk+-3.0`
g++.exe: error: Files/msys/mingw64/include/gtk-3.0: No such file or directory
g++.exe: error: Files/msys/mingw64/include/cairo: No such file or directory
g++.exe: error: Files/msys/mingw64/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include/pango-1.0: No such file or directory
g++.exe: error: Files/msys/mingw64/include/atk-1.0: No such file or directory
g++.exe: error: Files/msys/mingw64/include/cairo: No such file or directory
g++.exe: error: Files/msys/mingw64/include/pixman-1: No such file or directory
g++.exe: error: Files/msys/mingw64/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include/freetype2: No such file or directory
g++.exe: error: Files/msys/mingw64/include/libpng16: No such file or directory
g++.exe: error: Files/msys/mingw64/include/harfbuzz: No such file or directory
g++.exe: error: Files/msys/mingw64/include/glib-2.0: No such file or directory
g++.exe: error: Files/msys/mingw64/lib/glib-2.0/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include/freetype2: No such file or directory
g++.exe: error: Files/msys/mingw64/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include/harfbuzz: No such file or directory
g++.exe: error: Files/msys/mingw64/include/libpng16: No such file or directory
g++.exe: error: Files/msys/mingw64/include/gdk-pixbuf-2.0: No such file or directory
g++.exe: error: Files/msys/mingw64/include/libpng16: No such file or directory
g++.exe: error: Files/msys/mingw64/include/glib-2.0: No such file or directory
g++.exe: error: Files/msys/mingw64/lib/glib-2.0/include: No such file or directory
g++.exe: error: Files/msys/mingw64/include: No such file or directory
g++.exe: error: Files/msys/mingw64/lib: No such file or directory
my main.c code:
#include <gtk/gtk.h>
void
hello (void)
{
g_print ("Hello World\n");
}
void
destroy (void)
{
gtk_main_quit ();
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *button;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy), NULL);
gtk_container_border_width (GTK_CONTAINER (window), 10);
button = gtk_button_new_with_label ("Hello World");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (hello), NULL);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (window));
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (button);
gtk_widget_show (window);
gtk_main ();
return 0;
}
I know the reason of the error is the space in "Program Files" but How I can solve this problem without cutting all msys folder to another place?