2016-02-26 4 views
0

Я установил MinGW64 (MSYS2) в Windows 10/Surface Pro 2. Затем я установил GTK3 и многие другие пакеты с pacman, все 64-битные версии. Я даже смог запустить gtk3-demo, и окно всплыло. НО, я не могу получить простую программу для компиляции.gtk работает под окнами 10

программа:

#include <gtk/gtk.h> 

void on_window_destroy (GtkWidget *widget, gpointer user_data) 
{ 
    gtk_main_quit(); 
    /* quit main loop when windows closes */ 
} 


int main (int argc, char *argv[]) 
{ 
    GtkWidget *window, *label; 

    gtk_init (&argc,&argv); 
    /* initialize GTK+ */ 


    window = gtk_window_new (GTK_WINDOW_TOPLEVEL); 
    /* create the main window */ 

    label = gtk_label_new ("Hello world !"); 
    /* create a label with sample text */ 

    gtk_container_add (GTK_CONTAINER (window), label); 
    /* define the label as window child*/ 

    gtk_widget_show_all (window); 
    /* display window and children */ 


    g_signal_connect (window, "destroy", G_CALLBACK(on_window_destroy), NULL); 
    /* connect the window closing event with the "on_window_destroy" function */ 

    gtk_main(); 
    /* MAIN LOOP */ 

    return 0; 
} 

который составляется со всем этим из pkg-config --cflags --libs gtk+-3.0, а также я должен был добавить -L /opt/x86_64-w64-mingw32/lib получить потоковую работу.

Compile:

gcc test.c -mms-bitfields -pthread -mms-bitfields -I/mingw64/include/gtk-3.0 -I/mingw64/include/cairo -I/mingw64/include -I/mingw64/include/pango-1.0 -I/mingw64/include/atk-1.0 -I/mingw64/include/cairo -I/mingw64/include/pixman-1 -I/mingw64/include -I/mingw64/include/freetype2 -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include -I/mingw64/include/freetype2 -I/mingw64/include -I/mingw64/include/harfbuzz -I/mingw64/include/libpng16 -I/mingw64/include/gdk-pixbuf-2.0 -I/mingw64/include/libpng16 -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -L/mingw64/lib -LC:/building/msys64/mingw64/lib -L/mingw64/lib -LC:/building/msys64/mingw64/lib/../lib -L/mingw64/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lz -lepoxy -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lusp10 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lz -lpixman-1 -lfontconfig -lexpat -lfreetype -liconv -lexpat -lfreetype -lz -lbz2 -lharfbuzz -lpng16 -lz -lgdk_pixbuf-2.0 -lpng16 -lz -lgio-2.0 -lz -lgmodule-2.0 -pthread -lgobject-2.0 -lffi -lglib-2.0 -lintl -pthread -lws2_32 -lole32 -lwinmm -lshlwapi -lintl -L /opt/x86_64-w64-mingw32/lib 

Ошибка:

c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll):(.text+0x0): multiple definition of `_fmode' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-xtxtmode.o):(.bss+0x0): first defined here 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libkernel32.a(KERNEL32.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): string not null terminated in ILF object file. 
c:/program files (x86)/gcc/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/opt/x86_64-w64-mingw32/lib/libmsvcrt.a(msvcrt.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x116): undefined reference to `__getmainargs' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x1dd): undefined reference to `__imp_GetStartupInfoA' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x22d): undefined reference to `__imp_Sleep' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x2ad): undefined reference to `_initterm' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x2da): undefined reference to `_initterm' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x349): undefined reference to `__imp_SetUnhandledExceptionFilter' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.rdata$.refptr.__imp___initenv[.refptr.__imp___initenv]+0x0): undefined reference to `__imp___initenv' 
C:/Program Files (x86)/gcc/x86_64-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.rdata$.refptr.__imp__acmdln[.refptr.__imp__acmdln]+0x0): undefined reference to `__imp__acmdln' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-crt_handler.o): In function `__mingw_init_ehandler': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt_handler.c:87: undefined reference to `__imp_RtlAddFunctionTable' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-merr.o): In function `_matherr': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/merr.c:72: undefined reference to `fprintf' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-gs_support.o): In function `__security_init_cookie': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:62: undefined reference to `__imp_GetSystemTimeAsFileTime' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:70: undefined reference to `__imp_GetCurrentProcessId' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:74: undefined reference to `__imp_QueryPerformanceCounter' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-gs_support.o): In function `__report_gsfailure': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:111: undefined reference to `__imp_RtlCaptureContext' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:147: undefined reference to `__imp_SetUnhandledExceptionFilter' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:149: undefined reference to `__imp_GetCurrentProcess' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/gs_support.c:150: undefined reference to `abort' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o): In function `__report_error': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:156: undefined reference to `abort' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-atonexit.o): In function `mingw_onexit': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/atonexit.c:43: undefined reference to `_lock' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/atonexit.c:47: undefined reference to `__dllonexit' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/atonexit.c:51: undefined reference to `_unlock' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/atonexit.c:42: undefined reference to `__imp__onexit' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-pesect.o): In function `_FindPESectionByName': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/pesect.c:88: undefined reference to `strncmp' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o): In function `__mingw_TLScallback': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:129: undefined reference to `__imp_InitializeCriticalSection' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o): In function `__mingwthr_run_key_dtors': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:108: undefined reference to `__imp_TlsGetValue' 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:108: undefined reference to `__imp_TlsGetValue' 
C:/msys64/opt/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o): In function `__mingw_TLScallback': 
/msys_scripts/mingw-w64-cross-crt-git/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:145: undefined reference to `__imp_DeleteCriticalSection' 
collect2.exe: error: ld returned 1 exit status 

Как это исправить?

PS У меня уже был GCC, прежде чем я установил MinGW64. Возможно, существует конфликт между старым и новым?

ответ

3

MSYS2 ничего не устанавливает в «Program Files», поэтому, видя, что «c:/program files (x86)/gcc» в вашем сообщении об ошибке сообщает мне, что ваша система неверно настроена. Я рекомендую удалить ранее установленный GCC из переменной среды PATH, чтобы вы случайно не запускали его в MSYS2. Затем запустите оболочку MSYS2, используя ярлык, который называется «MinGW-w64 Win64 Shell» в вашем стартовом меню (или запуском mingw64_shell.bat). Затем запустите эту команду, чтобы установить 64-разрядные пакеты MinGW ToolChain:

pacman -S mingw-w64-x86_64-toolchain 

После выполнения этого типа which gcc и убедитесь, что это /mingw64/bin/gcc. Когда вы используете правильную инструментальную цепочку, это может решить ваши проблемы с GTK.

Кроме того, в моей установке MSYS2 нет ничего в /opt. Это просто пустой каталог. Если у вас есть файлы в /opt, то я подозреваю, что это неверно, и вы не должны пытаться их использовать. Чтобы выяснить, почему у вас есть файлы в /opt, вы можете запустить pacman -Qo /path/to/some/file, чтобы узнать, действительно ли эти файлы в /opt принадлежат пакету.

+0

Вы - мужчина! Я удалил свой предыдущий gcc, пришлось удалить путь к этому и BAM, он компилируется. Теперь я могу сосредоточиться на кодировании, а не на установке программного обеспечения. –

+0

В моей версии MSYS2 (в программах и функциях он говорит '20161025'), у меня нет' mingw64_shell.bat', но у меня есть 'C: \ msys64 \ msys2_shell.cmd -mingw32' или' C: \ msys64 \ usr \ bin \ mintty.exe C: \ msys64 \ msys2_shell.cmd -mingw32'. Для 64-битной версии MinGW вы можете заменить в предыдущих командах '-mingw32' на' -mingw64'. – silviubogan

Смежные вопросы