Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go, cmd/cgo: build with odbc package fails for linux #11378

cadamini opened this issue Jun 24, 2015 · 1 comment


Copy link

commented Jun 24, 2015

Since I use / my program, my build fails for linux.

_What version of Go are you using (go version)?_
go version go1.4.2 darwin/amd64

_What operating system and processor architecture are you using?_

_What did you do?_
I was able to build my app before I have inserted the odbc package ( Then I added the package and installed UnixODBC and FreeTDS.

_What did you expect to see?_
I thought go could compile binaries for Mac, Linux and Windows independent from the packages used.

_What did you see instead?_
I encountered the error message below when executing make.

My terminal shows:
GOARCH=amd64 GOOS=linux goop exec go build -ldflags "-X main.VERSION cat VERSION -X main.BUILD_DATE date -u +%d.%m.%Y-%H:%M:%S" -o /Users/cadamini/GoApps/connect-client/bin/linux-amd64/connect ./main.go
.vendor/src/ undefined: SQLSMALLINT
.vendor/src/ undefined: SQLUSMALLINT
.vendor/src/ undefined: SQLUSMALLINT

Do I see a bug or is it just a configuration issue?


This comment has been minimized.

Copy link

commented Jun 25, 2015 package uses cgo on linux (see api/api_unix.go). You cannot cross-compile packages that use cgo.


PS: package is moved now to

@mikioh mikioh changed the title build with odbc package fails for linux cmd/go, cmd/cgo: build with odbc package fails for linux Jun 25, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
3 participants
You can’t perform that action at this time.