webview/webview_go

Could not import github.com/webview/webview_go

zhanxiaox opened this issue · 6 comments

err

  • use go mod tidy download package,could not import when i run or build.

Can you build one of the examples using the instructions provided in the readme file?

err
I searched for the relevant error reasons. Is it necessary to have the GCC environment and enable CGO_ENABLED?

err I searched for the relevant error reasons. Is it necessary to have the GCC environment and enable CGO_ENABLED?

err2
I have installed gcc and config CGO_ENABLED=1 to build examples, but I encountered more issues. Did I do something wrong?

There are some cases where CGO_ENABLED isn't set to 1 by default and in those cases you need to set it to 1 by yourself. You can check the documentation of cgo.

The error doesn't seem related to the core webview library. Are you compiling with a Cygwin environment? If so then I suggest trying e.g. MSYS2 or WinLibs instead.

If you want to keep using Cygwin then please know that I haven't personally tested with it. Also, are you sure you don't need to compile inside a special Cygwin shell/terminal rather than with PowerShell?

Ok,Thank you very much,Use MSYS2 install gcc environment,Examples worked now,And in MSYS2's shell seem can't load system's path,I have added MSYS2/bin to the system's path.

I'm glad that works although it may be a good idea to choose a specific MSYS2 environment such as UCRT64, MINGW64 or CLANG64.

Can we can close this issue?