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

Closed
opened 2023-02-23 19:12:39 +00:00 by jsoneaday · 3 comments
jsoneaday commented 2023-02-23 19:12:39 +00:00 (Migrated from github.com)

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/napi-go@v0.0.0-20220627001427-7ae2cc336fa2/async_work.go:9:9: undefined: NapiGoAsyncWorkID
../../../../go/pkg/mod/github.com/akshayganeshen/napi-go@v0.0.0-20220627001427-7ae2cc336fa2/async_work.go:14:49: undefined: Status
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/napi-go@v0.0.0-20220627001427-7ae2cc336fa2/async_work.go:9:9: undefined: NapiGoAsyncWorkID ../../../../go/pkg/mod/github.com/akshayganeshen/napi-go@v0.0.0-20220627001427-7ae2cc336fa2/async_work.go:14:49: undefined: Status ```
akshayganeshen commented 2023-03-02 00:10:22 +00:00 (Migrated from github.com)

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.

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 commented 2023-05-13 13:29:09 +00:00 (Migrated from github.com)

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.

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 commented 2023-09-08 19:24:11 +00:00 (Migrated from github.com)

@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?

@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 in to join this conversation.
No description provided.