Cross-platform build for Linux failed when building in Windows
When I tried to do cross-platform build on Windows for Linux, I encountered the following errors: ......\go\pkg\mod\github.com\alexbrainman\[email protected]\api\api.go:17:9: undefined: SQLSMALLINT ......\go\pkg\mod\github.com\alexbrainman\[email protected]\api\api.go:18:9: undefined: SQLUSMALLINT
@ppinghu
If you want more help here, you need to tell me what command you run and provide complete output.
I assume that you know that this package uses cgo to building Linux version. So you will need to install all required C tools and libraries.
Alex
I simply use GOOS=Linux GOARCH=amd64 go build.
However I think I have figured the problem is that Windows does not have the proper ODBC driver for Linux. So I have to go to VM to build for Linux. That was successful.
Next I tried to build for MacOS from Linux and it did not work either. I thought both Linux and MacOS uses cgo and unix ODBC driver so it should work.
I simply use GOOS=Linux GOARCH=amd64 go build.
This is not a valid Windows build command. But if it works for you, it is fine with me.
However I think I have figured the problem is that Windows ...
Good.
Alex