zeroair / odbc

Automatically exported from code.google.com/p/odbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

cross-compile for linux shows undefined: SQLSMALLINT, SQLUSMALLINT and SQLUSMALLINT (api.go line 13-15) #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run go build on Mac OSX trying to compile a linux version of an executable 
using odbc

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

Actually we have tried to run this on a Debian Linux box as suggested in older 
posts about this topic without success. 
Do you see any mistake or configuration issue at my end or is it a bug in the 
odbc or Go code itself?

Original issue reported on code.google.com by christia...@invision.de on 24 Jun 2015 at 9:28

GoogleCodeExporter commented 8 years ago
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.

Original comment by alex.bra...@gmail.com on 25 Jun 2015 at 12:09

GoogleCodeExporter commented 8 years ago
Thanks anyway. That's what I wanted to hear as a confirmation.

Original comment by christia...@invision.de on 25 Jun 2015 at 8:11