Answer the question
In order to leave comments, you need to log in
How to build a golang project that uses CGO?
Hello! Please help me figure it out. I wrote a Golang application
on Windows 10 . This application uses several third-party libraries. One of them is goracle for connecting to Oracle database. The project is running locally.
On my local machine (windows 10) I'm trying to build a binary with the following command:
$Env:GOOS = "linux"; $Env:GOARCH = "amd64"; go build
# gopkg.in/goracle.v2
../gopkg.in/goracle.v2/orahlp.go:60:2: undefined: describeOnly
../gopkg.in/goracle.v2/orahlp.go:223:26: undefined: PlSQLArrays
../gopkg.in/goracle.v2/orahlp.go:246:32: undefined: VersionInfo
../gopkg.in/goracle.v2/orahlp.go:249:10: undefined: VersionInfo
../gopkg.in/goracle.v2/orahlp.go:255:32: undefined: VersionInfo
../gopkg.in/goracle.v2/orahlp.go:272:19: undefined: VersionInfo
../gopkg.in/goracle.v2/orahlp.go:273:31: undefined: ObjectType
../gopkg.in/goracle.v2/orahlp.go:274:31: undefined: Event
../gopkg.in/goracle.v2/orahlp.go:274:41: undefined: Subscription
../gopkg.in/goracle.v2/orahlp.go:284:27: undefined: conn
../gopkg.in/goracle.v2/orahlp.go:249:10: too many errors
Answer the question
In order to leave comments, you need to log in
The easiest way for you to build this whole thing directly on CentOS.
CGO does not need to be assembled, it already works out of the box. It's just that you don't have the Linux binary libraries on your Windows machine that you need to build. So build under CentOS with oracle libraries installed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question