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

Closed
cadamini opened this issue Jun 24, 2015 · 1 comment

Comments

@cadamini
Copy link

commented Jun 24, 2015

Since I use /code.google.com/p/odbc/ 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?_
Mac OSX

_What did you do?_
I was able to build my app before I have inserted the odbc package (code.google.com/p/odbc). 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
'# code.google.com/p/odbc/api
.vendor/src/code.google.com/p/odbc/api/api.go:13: undefined: SQLSMALLINT
.vendor/src/code.google.com/p/odbc/api/api.go:14: undefined: SQLUSMALLINT
.vendor/src/code.google.com/p/odbc/api/api.go:15: undefined: SQLUSMALLINT

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

@alexbrainman

This comment has been minimized.

Copy link
Member

commented Jun 25, 2015

code.google.com/p/odbc package uses cgo on linux (see api/api_unix.go). You cannot cross-compile packages that use cgo.

Alex

PS: code.google.com/p/odbc package is moved now to github.com/alexbrainman/odbc.

@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.
Projects
None yet
3 participants
You can’t perform that action at this time.