Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on Win10: undefined: wrapMenuModel #916

Open
phplego opened this issue Feb 11, 2024 · 1 comment
Open

Build failed on Win10: undefined: wrapMenuModel #916

phplego opened this issue Feb 11, 2024 · 1 comment
Labels

Comments

@phplego
Copy link

phplego commented Feb 11, 2024

Description
Build failed

To Reproduce
Steps to reproduce the behavior:

  • Install MSYS2
  • Install gtk package pacman -S mingw-w64-x86_64-gtk3
  • run go build on any gotk3 code

Expected behavior
go build with no errors

Error messages

MINGW64 /c/Users/AUSER/go-gtk
$ go build -x
WORK=C:\msys64\tmp\go-build899821325
mkdir -p $WORK\b004\
cat >C:\msys64\tmp\go-build899821325\b004\importcfg << 'EOF' # internal
# import config
packagefile reflect=C:\Users\AUSER\AppData\Local\go-build\87\878162c22428b3273a9b64fe8669e6cbd99d637
04c9617409b4aa23d0426554a-d
EOF
cd C:\Users\AUSER\go-gtk-hello-world
"C:\\msys64\\mingw64\\lib\\go\\pkg\\tool\\windows_amd64\\compile.exe" -o "$WORK\\b004\\_pkg_.a" -tri
mpath "$WORK\\b004=>" -p github.com/gotk3/gotk3/glib -lang=go1.14 -complete -buildid TKKC2_MxVgpjrcm
vHX1c/TKKC2_MxVgpjrcmvHX1c -goversion go1.22.0 -c=2 -nolocalimports -importcfg "$WORK\\b004\\importc
fg" -pack "C:\\Users\\AUSER\\go\\pkg\\mod\\github.com\\gotk3\\gotk3@v0.6.3\\glib\\cast.go" "C:\\User
s\\AUSER\\go\\pkg\\mod\\github.com\\gotk3\\gotk3@v0.6.3\\glib\\finalizers.go" "C:\\Users\\AUSER\\go\
\pkg\\mod\\github.com\\gotk3\\gotk3@v0.6.3\\glib\\glib_extension.go" "C:\\Users\\AUSER\\go\\pkg\\mod
\\github.com\\gotk3\\gotk3@v0.6.3\\glib\\glib_since_2_64.go"
# github.com/gotk3/gotk3/glib
..\go\pkg\mod\github.com\gotk3\gotk3@v0.6.3\glib\cast.go:6:11: undefined: wrapMenuModel


Environment:
gtk3 version: 3.24.41
go version: 'go1.22.0 windows/amd64'
os: Windows 10

$ pkg-config --cflags --libs gtk+-3.0
-I/mingw64/include/gtk-3.0 -I/mingw64/include/pango-1.0 -I/mingw64/include/cairo -I/mingw64/include/harfbuzz -I/mingw64/include/freetype2 -I/mingw64/include/gdk-pixbuf-2.0 -I/mingw64/include/atk-1.0 -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include/pixman-1 -I/mingw64/include/libpng16 -I/mingw64/include/webp -DLIBDEFLATE_DLL -I/mingw64/include/fribidi -lgtk-3 -lgdk-3 -lz -lgdi32 -limm32 -lshell32 -lole32 -luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lhid -lwinspool -lcomctl32 -lcomdlg32 -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
$ pkg-config --modversion gtk+-3.0
3.24.41
@phplego phplego added the bug label Feb 11, 2024
@phplego phplego changed the title [BUG] Build failed on Win10: undefined: wrapMenuModel Build failed on Win10: undefined: wrapMenuModel Feb 11, 2024
@veigaribo
Copy link
Contributor

In my case, from what I could tell, this was happening because Go could not find a C compiler, so it ignored CGO files (like glib/menu.go, where wrapMenuModel is defined) and then failed with that very unhelpful message. You should see all CGO files in the IgnoredGoFiles section if you run go list -e -json -compiled ./... in the glib directory.

It stopped happening as soon as I got a gcc on the PATH (installed mingw-w64-x86_64-toolchain IIRC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants