fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.97k stars 1.38k forks source link

run demo error:# runtime/cgo cgo: cannot parse $WORK\b228\_cgo_.o as ELF, Mach-O, PE or XCOFF #4661

Open yuyanan1314 opened 8 months ago

yuyanan1314 commented 8 months ago

Checklist

Describe the bug

1 computer system is windows10 64bit 2 go version go1.22.0 windows/amd64 3 gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 4 fyne Environment Check is pass all 5 run command: go run fyne.io/fyne/v2/cmd/fyne_demo@latest 6 Before today, it was working fine, but after restarting the computer today, it suddenly started throwing an error.

runtime/cgo

cgo: cannot parse $WORK\b228_cgo_.o as ELF, Mach-O, PE or XCOFF

How to reproduce

help help! my english is bad

Screenshots

help me

Example code

package main

import ( "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/widget" )

func main() { app := app.New() // 创建应用程序实例 window := app.NewWindow("Hello world") // 创建窗口,标题为"Hello Wolrd" window.SetContent(widget.NewLabel("Hello world!")) // 往窗口中放入一个内容为"Hello world!"的标签控件 window.ShowAndRun() //展示并运行程序 }

Fyne version

v2

Go compiler version

1.22

Operating system and version

windows10

Additional Information

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=D:/develop/software/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib ' Thread model: posix gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)

andydotxyz commented 8 months ago

This looks like a cache corruption, possibly caused if you upgraded Go or mingw recently? I would recommend clearing all Go caches and trying again.