Can't build GTK-2-24 on Windows (MSYS2)
I was attempting to backport a patch, but unfortunately I can't build the current GTK-2-24 branch. I get hundreds of messages like these:
- multiple definition of `gdk_threads_mutex'
- multiple definition of `gdk_threads_unlock'
- multiple definition of `gdk_threads_lock'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkapplaunchcontext.o:C:\gtk\gdk/../gdk/gdk.h:193: multiple definition of `gdk_threads_unlock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:193: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkapplaunchcontext.o:C:\gtk\gdk/../gdk/gdk.h:192: multiple definition of `gdk_threads_lock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:192: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkapplaunchcontext.o:C:\gtk\gdk/../gdk/gdk.h:189: multiple definition of `gdk_threads_mutex'; .libs/gdk.o:C:\gtk\gdk/gdk.h:189: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcairo.o:C:\gtk\gdk/../gdk/gdk.h:193: multiple definition of `gdk_threads_unlock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:193: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcairo.o:C:\gtk\gdk/../gdk/gdk.h:192: multiple definition of `gdk_threads_lock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:192: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcairo.o:C:\gtk\gdk/../gdk/gdk.h:189: multiple definition of `gdk_threads_mutex'; .libs/gdk.o:C:\gtk\gdk/gdk.h:189: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcolor.o:C:\gtk\gdk/../gdk/gdk.h:193: multiple definition of `gdk_threads_unlock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:193: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcolor.o:C:\gtk\gdk/../gdk/gdk.h:192: multiple definition of `gdk_threads_lock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:192: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcolor.o:C:\gtk\gdk/../gdk/gdk.h:189: multiple definition of `gdk_threads_mutex'; .libs/gdk.o:C:\gtk\gdk/gdk.h:189: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcursor.o:C:\gtk\gdk/../gdk/gdk.h:193: multiple definition of `gdk_threads_unlock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:193: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcursor.o:C:\gtk\gdk/../gdk/gdk.h:192: multiple definition of `gdk_threads_lock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:192: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkcursor.o:C:\gtk\gdk/../gdk/gdk.h:189: multiple definition of `gdk_threads_mutex'; .libs/gdk.o:C:\gtk\gdk/gdk.h:189: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkdisplay.o:C:\gtk\gdk/gdk.h:193: multiple definition of `gdk_threads_unlock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:193: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkdisplay.o:C:\gtk\gdk/gdk.h:192: multiple definition of `gdk_threads_lock'; .libs/gdk.o:C:\gtk\gdk/gdk.h:192: first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .libs/gdkdisplay.o:C:\gtk\gdk/gdk.h:189: multiple definition of `gdk_threads_mutex'; .libs/gdk.o:C:\gtk\gdk/gdk.h:189: first defined here
...
How I attempted to build:
- Launch MSYS2-MINGW64 shell
- navigate to root directory of gtk repository
./automake.sh
make
I even tried following the commands in the .gitlab-ci line-by-line, but I still got the same errors. I updated all my MSYS2 packages to the latest version just to be sure, still getting the same errors.