Skip to content

Library and Include paths vary depending on UNIX OS #14

@wtfiwtz

Description

@wtfiwtz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions