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

Error building: undefined: NapiGoAsyncWorkID and undefined: Status #5

Open
jsoneaday opened this issue Feb 23, 2023 · 3 comments
Open

Comments

@jsoneaday
Copy link

jsoneaday commented Feb 23, 2023

I'm on an m1 mac and running below command when this error occurs.

CGO_LDFLAGS_ALLOW=-Wl,-no_pie GOOS=darwin GOARCH=arm64 go build -buildmode=c-shared -o "example.node" -a ./cmd

# github.com/akshayganeshen/napi-go
../../../../go/pkg/mod/github.com/akshayganeshen/[email protected]/async_work.go:9:9: undefined: NapiGoAsyncWorkID
../../../../go/pkg/mod/github.com/akshayganeshen/[email protected]/async_work.go:14:49: undefined: Status
@akshayganeshen
Copy link
Owner

Apologies for the slow reply on this. I took a quick look at the symbols when attempting to cross compile, and still haven't been able to work out where it breaks 🤔.

I imagine this'd be a problem on any GOOS, as the culprit seems to be the GOARCH here, but not sure why... I'll continue taking a look though.

@ACenterA
Copy link

ACenterA commented May 13, 2023

You can try with:

export CC=clang
export CGO_ENABLED=1

We had the same issue but with CGO_ENABLED it worked without errors.

@akshayganeshen thank you for this golang project, hopefully it will stay maintained and functional. It seems to work great for our needs.

@omar391
Copy link

omar391 commented Sep 8, 2023

@akshayganeshen In docker env I had to do CGO_ENABLED=0 and the solution above doesn't work. Is there any other way to fix this?

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

4 participants