go编译go-gtk报错

go build 报如下错误

go build github.com/mattn/go-gtk/gio: invalid flag in pkg-config --libs: -Wl,-luuid
go build github.com/mattn/go-gtk/gdk: invalid flag in pkg-config --libs: -Wl,-luuid
解决方法

进入:C:\msys64\mingw64\lib\pkgconfig
修改gdk-2.0.pc和gdk-win32-2.0.pc

Name: GDK
Description: GTK+ Drawing Kit (${target} target)
Version: 2.24.32
Requires: pangowin32 pangocairo gio-2.0 gdk-pixbuf-2.0 cairo-win32
Libs: -L${libdir} -lgdk-${target}-2.0  -lgdi32 -limm32 -lshell32 -lole32 -luuid
Cflags: -I${includedir}/gtk-2.0 -I${libdir}/gtk-2.0/include 
LDFLAGS: -Wl

将原本在Libs中的-Wl删除,增加一行LDFLAGS: -Wl

其他3.0需修改的文件参考:gdk-2.0.pc, gdk-win32-2.0.pc, gdk-broadway-3.0.pc
转自https://blog.csdn.net/zanget/article/details/80604186

你可能感兴趣的:(go)