On Thu, Feb 23, 2023 at 1:18 PM David Choi (jsoneaday) <dharri...@gmail.com> wrote: > > Hi I'm trying to build my project as C so I can call it from Nodejs. But when > I run the command "go build -buildmode=c-shared -o keyring.so ." I get a so > file but no h C header. > > I am running this on Mac M1. I read something about cgo being disabled by > default on mac's without the c toolchain but I do have gcc installed so not > sure what's up.
You will only get a C header file if your code uses //export to export some functions to be callable from C code. If you are doing that already, show us a small self-contained example that we can use to recreate the problem. Thanks. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUumVS9%2BcTfmLOw0UA1%3DY0Cc0ajtDVZkmoWqQ2pQoiC1Q%40mail.gmail.com.