Skip to content

mingw expected in incorrect location (tinygo-macos) #3987

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

Open
coolaj86 opened this issue Nov 4, 2023 · 2 comments
Open

mingw expected in incorrect location (tinygo-macos) #3987

coolaj86 opened this issue Nov 4, 2023 · 2 comments
Labels

Comments

@coolaj86
Copy link

coolaj86 commented Nov 4, 2023

Error about _mingw.h.in

GOOS=windows GOARCH=amd64 tinygo build .
error: open ~/.local/opt/tinygo-0.30.0/lib/mingw-w64/mingw-w64-headers/crt/_mingw.h.in: no such file or directory

Actual Location

The actual location appears to be...

pushd ~/.local/opt/tinygo/
fd | rg 'mingw'
~/.local/opt/tinygo/lib/mingw-w64/mingw-w64-headers/_mingw.h.in
@coolaj86
Copy link
Author

coolaj86 commented Nov 4, 2023

Workaround

Go to the mingw-w64-headers and link itself to crt:

pushd ~/.local/opt/tinygo-0.30.0/lib/mingw-w64/mingw-w64-headers/
ln -s ./. ./crt

Though... that lead me to the next error:

go: downloading golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7
tinygo:ld.lld: error: undefined symbol: golang.org/x/sys/windows.getprocaddress
>>> referenced by main
>>>               /var/folders/7d/97myp70d0qg1lrlykkf7t31r0000gn/T/tinygo2730146990/main.o

tinygo:ld.lld: error: undefined symbol: golang.org/x/sys/windows.loadlibrary
>>> referenced by main
>>>               /var/folders/7d/97myp70d0qg1lrlykkf7t31r0000gn/T/tinygo2730146990/main.o
failed to run tool: ld.lld
error: failed to link /var/folders/7d/97myp70d0qg1lrlykkf7t31r0000gn/T/tinygo2730146990/main.exe: exit status 1

@soypat soypat added the macOS label Dec 3, 2023
@brettinternet
Copy link

I have the same issue but I've installed tinygo via Homebrew so my root paths are a little different:

GOOS=windows tinygo build .
open /opt/homebrew/Cellar/tinygo/0.37.0/lib/mingw-w64/mingw-w64-headers/crt/_mingw.h.in: no such file or directory

The actual path appears to be:

/opt/homebrew/Cellar/tinygo/0.37.0/lib/mingw-w64/mingw-w64-headers/_mingw.h.in

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

3 participants