gopgsqldriver icon indicating copy to clipboard operation
gopgsqldriver copied to clipboard

Library and Include paths vary depending on UNIX OS

Open wtfiwtz opened this issue 10 years ago • 1 comments

I had to replace these lines in pgdriver.go:

// #cgo CFLAGS: -I/usr/local/pglib/include
// #cgo LDFLAGS: -L/usr/local/pglib/lib -lpq

For me, they were (using Postgres from Mac OS X with Homebrew):

// #cgo CFLAGS: -I/usr/local/Cellar/postgresql/9.3.4/include
// #cgo LDFLAGS: -L/usr/local/Cellar/postgresql/9.3.4/lib -lpq

Run 'pg_config --includedir' and 'pg_config --libdir' to find out what they should be, and then rebuilt pgsqldriver:

cd src/github.com/jbarham/gopgsqldriver
./gen_pg_type.sh
go build pgdriver.go pg_type.go

I'm not sure how to go about making this more cross-OS friendly in general (just learning Go now), but hopefully these instructions help someone else.

wtfiwtz avatar Jul 11 '14 05:07 wtfiwtz

Sorry, just saw pull request #12 just before I was about to get on a flight... not sure how I missed it before. You can probably close this ticket then.

wtfiwtz avatar Jul 14 '14 04:07 wtfiwtz