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

Could not import github.com/webview/webview_go #12

Closed
zhanxiaox opened this issue Oct 8, 2023 · 6 comments
Closed

Could not import github.com/webview/webview_go #12

zhanxiaox opened this issue Oct 8, 2023 · 6 comments

Comments

@zhanxiaox
Copy link

err

  • use go mod tidy download package,could not import when i run or build.
@SteffenL
Copy link
Contributor

SteffenL commented Oct 8, 2023

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

@zhanxiaox
Copy link
Author

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

@zhanxiaox
Copy link
Author

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?

@SteffenL
Copy link
Contributor

SteffenL commented Oct 9, 2023

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?

@zhanxiaox
Copy link
Author

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.

@SteffenL
Copy link
Contributor

SteffenL commented Oct 9, 2023

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?

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

No branches or pull requests

2 participants