macosgogolandmacos-sequoia

go language, macOS: fatal error: 'sql.h' file not found


Apple Silicon, Sequoia.

I do have the library, in /opt/homebrew/include/sql.h , /opt/homebrew/Cellar/unixodbc/2.3.12/include/sql.h and following suggestions online I created a sym link in /opt/homebrew/bin/sql.h but nothing is helping fixing the error.

This happens when trying to build code that used to build fine in another mac (also apple silicon)

-edit: the full error I get is:

/usr/bin/make -f /Users/xxxxxxx/Documents/github/yyyyyyyyy/Makefile -C /Users/xxxxxxx/Documents/github/yyyyyyyyy build
go build -o yyyyyyyyy -mod vendor ./cmd/yyyyyyyyy
# github.com/alexbrainman/odbc/api
vendor/github.com/alexbrainman/odbc/api/api_unix.go:15:11: fatal error: 'sql.h' file not found
   15 |  #include <sql.h>
      |           ^~~~~~~
1 error generated.
make: *** [build] Error 1

Process finished with exit code 2

and that line 15:11 that can be found online is:

// #include <sql.h>

The main issue here is that the same code compiles just fine on another Mac, so it's a configuration issue on my mac, but I don't really know how to troubleshoot this error and looking online didn't help so far.

any help is appreciated :)


Solution

  • This was answered here in the end :)

    https://github.com/alexbrainman/odbc/issues/215