microo8 / plgo

easily create postgresql extensions in golang; moved to gitlab.com/microo8/plgo
292 stars 22 forks source link

CentOS 7 postgres.h error #4

Closed GrandFelix closed 6 years ago

GrandFelix commented 6 years ago

Hi,

Im getting this when trying to install it:

# github.com/microo8/plgo
/root/go/src/github.com/microo8/plgo/pl.go:7:22: fatal error: postgres.h: No such file or directory
 #include "postgres.h"
                      ^
compilation terminated.

I have installed all devel packages etc. Im on Pg9.6, CentOS 7

microo8 commented 6 years ago

plgo runs pg_config --includedir-server to add the include path for pg header files.

What it prints if you run it in terminal?

If you just install it, don't worry if you have this error. The main thing is that you got the plgo command.

GrandFelix commented 6 years ago

I get /usr/pgsql-9.6/include/server and also there is postgres.h header file

microo8 commented 6 years ago

And after you run go get -u github.com/microo8/plgo/... you have the plgo command, or it fails?

microo8 commented 6 years ago

Try also to run just go get -u github.com/microo8/plgo/plgo

GrandFelix commented 6 years ago

This does not return any error but I dont have plgo command. Im new to go environment so maybe I did forget on something?

microo8 commented 6 years ago

Check if the plgo binary exists in $GOPATH/bin/

GrandFelix commented 6 years ago

Yes it is, in home.../go/ because i did not have $GOPATH configured. Everything is OK now. Thank you

microo8 commented 6 years ago

You can add to your $PATH the $GOPATH/bin, so you can run commands directly, right when you go get something.

GrandFelix commented 6 years ago

Ok, will do that. Thank you!