go项目在linux下编译出现 fatal error: sql.h compilation terminated,解决

go项目引入

github.com/alexbrainman/odbc

 

linux下编译出现了问题:

/root/go/pkg/mod/github.com/alexbrainman/odbc@v0.0.0-20210605012845-39f8520b0d5f/api/api_unix.go:14:18: fatal error: sql.h: No such file or directory
 // #include <sql.h>
                  ^
compilation terminated.j 

 

主要是因为缺少unixODBC

 

解决方式:

centos系统: yum install unixODBC-devel

debian系统:apt-get install unixodbc unixodbc-dev

参考:r - How to install & locate ODBC headers sql.h and sqlext.h on a macOS - Stack Overflow  InstallingUnixODBC · alexbrainman/odbc Wiki (github.com)  https://github.com/alexbrainman/odbc/issues/107#issuecomment-390863760

 

posted @ 2021-09-08 15:56  叨叨的蜗牛  阅读(1002)  评论(0)    收藏  举报