cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Compiling issues with golang gobolt + Seabolt driver

Hi,

I am trying to run the sample code available at (https://neo4j.com/developer/go/) using golang neo4j driver but running into issues.
I have build the seabolt 1.7.4 from source.
Have the following variables in place
PKG_CONFIG_PATH pointing to seabolt-1.7.4/build/dist/share/pkgconfig
OPENSSL_ROOT_DIR=/usr/local/opt/openssl
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/seabolt-1.7.4/build/dist/lib

When I try to build my code with command
env GOOS=linux go build -ldflags="-s -w" --tags seabolt_static -o bin/user users/user.go

I get the following error

github.com/neo4j-drivers/gobolt

../pkg/mod/github.com/neo4j-drivers/gobolt@v1.7.4/connector_worker.go:30:14: undefined: Config
../pkg/mod/github.com/neo4j-drivers/gobolt@v1.7.4/connector_worker.go:31:15: undefined: seaboltConnector

Can anyone point me in right direction.

  • Go
2 REPLIES 2

jeremy
Node Clone

We also getting the same issue / waiting on response from Neo4J other than check the version number

github.com/neo4j-drivers/gobolt

../../github.com/neo4j-drivers/gobolt/connector_worker.go:30:14: undefined: Config
../../github.com/neo4j-drivers/gobolt/connector_worker.go:31:15: undefined: seaboltConnector

Hi @jmadan,

Go driver doesn't support cross compilation scenarios (just because it depends on a native library - seabolt - through cgo). Does it successfully build when you don't specify GOOS as part of the go build command, i.e. does it build and run on macos?

The only suggestion I could make for you is probably to use a docker based pipeline so that you can build a static binary that you could deploy to your staging environment. I think this Dockerfile would be a good starting point.

Thanks.