Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Can it build in linux? #61

Closed
ckanner opened this issue Apr 23, 2018 · 10 comments
Closed

Can it build in linux? #61

ckanner opened this issue Apr 23, 2018 · 10 comments

Comments

@ckanner
Copy link

ckanner commented Apr 23, 2018

Now I use gopkg.in/goracle.v2 in MacOS.I want build my project and run it in linux.Then I exec the command in the project dir in My MacOS.

The commandGOOS=linux GOARCH=amd64 go build.

Some error occurs

# 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

How can I fix it?

@tgulacsi
Copy link
Contributor

See #59 - it needs CGO, with proper cross-compiler - easier to build it natively (or in Docker).

@ckanner
Copy link
Author

ckanner commented Apr 23, 2018

You mean I can compile it in linux directly? And Also can build it in Docker?

@tgulacsi
Copy link
Contributor

tgulacsi commented Apr 23, 2018 via email

@derFunk
Copy link

derFunk commented Apr 23, 2018

Just leaving a note here that I just encountered the same problem.

@marct83
Copy link

marct83 commented Apr 25, 2018

Also running into this problem

@tgulacsi
Copy link
Contributor

What is the problem?
What does

go get -x gopkg.in/goracle.v2

prints?
Do you have a C compiler installed?

@fantasyjqc
Copy link

go/src/gopkg.in/goracle.v2/orahlp.go:224: undefined: sql.Out
go/src/gopkg.in/goracle.v2/orahlp.go:288: undefined: sql.Out
go/src/gopkg.in/goracle.v2/stmt.go:111[/tmp/go-build543400498/gopkg.in/goracle.v2/_obj/stmt.cgo1.go:116]: undefined: driver.NamedValueChecker
go/src/gopkg.in/goracle.v2/stmt.go:220[/tmp/go-build543400498/gopkg.in/goracle.v2/_obj/stmt.cgo1.go:244]: undefined: sql.Out
go/src/gopkg.in/goracle.v2/stmt.go:542[/tmp/go-build543400498/gopkg.in/goracle.v2/_obj/stmt.cgo1.go:656]: undefined: sql.Out
go/src/gopkg.in/goracle.v2/stmt.go:1600[/tmp/go-build543400498/gopkg.in/goracle.v2/_obj/stmt.cgo1.go:1908]: undefined: driver.ErrRemoveArgument

Some error occurs
How can I fix it?

@tgulacsi
Copy link
Contributor

tgulacsi commented Jun 1, 2018

Use at least Go 1.9 - preferably the current stable, 1.10.2 !

@fantasyjqc
Copy link

thank you, it's work now

@goheader
Copy link

Sure. It only needs a Go version >=1.9 and a C compiler for CGO. Kanner notifications@github.com ezt írta (időpont: 2018. ápr. 23., H, 12:24):

You mean I can compile it in linux directly? And Also can build it in Docker? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#61 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPoSuomeJIHiLYfu_AgZwXDcXoeeKN0ks5travXgaJpZM4Tfm6J .

how can I install cgo?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants