webview: Can't compile example with golang.

What OS are you using (uname -a, or Windows version)?

Windows 10 Pro 1903(18362.657)

What programming language are you using (C/C++/Go/Rust)?

Go:

go version go1.14 windows/amd64

Gcc:

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=C:/TDM-GCC-64/bin/…/libexec/gcc/x86_64-w64-mingw32/5.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: …/…/…/src/gcc-5.1.0/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs Thread model: posix gcc version 5.1.0 (tdm64-1)

What did you expect to see and what you saw instead?

Hello, i can’t compile example with go. Some errors occured:

go build -ldflags=“-H windowsgui” -o webview-example.exe

# github.com/zserge/webview C:\Users\BEZRAZ~1\AppData\Local\Temp\go-build996545186\b002\_x002.o: In function CgoWebViewBind’: C:/Users/bezrazli4n0/go/src/github.com/zserge/webview/webview.go:41: undefined reference to webview_bind' C:\Users\BEZRAZ~1\AppData\Local\Temp\go-build996545186\b002\_x002.o: In function _cgo_513c5b174c28_Cfunc_webview_return’: /tmp/go-build/cgo-gcc-prolog:181: undefined reference to webview_return' collect2.exe: error: ld returned 1 exit status

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 22

Most upvoted comments

Have same errors when trying install new version via “go get” on Windows.

C:\TDM-GCC-64>go get github.com/zserge/webview go: finding github.com/zserge/webview latest

github.com/zserge/webview

C:\Users\liri\AppData\Local\Temp\go-build137265670\b001_x002.o: In function CgoWebViewBind': E:/Sites/go/pkg/mod/github.com/zserge/webview@v0.0.0-20200301213939-0eb933f25974/webview.go:41: undefined reference to webview_bind’ C:\Users\liri\AppData\Local\Temp\go-build137265670\b001_x002.o: In function _cgo_17ab966533ea_Cfunc_webview_return': /tmp/go-build/cgo-gcc-prolog:181: undefined reference to webview_return’ collect2.exe: error: ld returned 1 exit status

webview_dlls.zip These two DLLs did the trick for me. WebView2Loader.dll is from ./script/microsoft.web.webview2.0.9.488/build/x64 and webview.dll is from ./build after running the .bat script. Other combinations don’t work and fail with different errors

Can anyone

Ok, i compile dlls and put it inside .exe folder of my project, but now window is bugging, i can’t resize by mouse, and window is work only in fullscreen mode, if i minimize it, crash will happened.

Can you push the new DLLs please?

There are any news related this issue? It ticket have been opened while ago without a resolution. The example in documentation never works in Windows 10.

HintMin works perfectly