-
Notifications
You must be signed in to change notification settings - Fork 41
Description
I got one error when I am following the readme instructions:
zac$ go run db2connect1.go
runtime/cgo
clang: error: -l/home/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/include: 'linker' input unused [-Werror,-Wunused-command-line-argument]
How can I fix it?
db2connect1.go:
package main
import (
_ "github.com/ibmdb/go_ibm_db"
"database/sql"
"fmt"
)
func main(){
con:="HOSTNAME=dashdb.services.eu-gb.bluemix.net;DATABASE=BLUDB;PORT=50000;UID=username;PWD=password"
db, err:=sql.Open("go_ibm_db", con)
if err != nil{
fmt.Println(err)
}
db.Close()
}
--------I am using Mac, and here is the go env:
ruihuaz-MacBook-Pro:src zac$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zac/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/zac/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-l/home/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/include"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-L/home/zac/go/src/github.com/ibmdb/go_ibm_db/installer/clidriver/lib"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hx/0bd3dc5j2f95jy7lxjf51w5c0000gn/T/go-build020472211=/tmp/go-build -gno-record-gcc-switches -fno-common"