Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: proj.h: No such file or directory #2

Open
lithium555 opened this issue Nov 8, 2023 · 0 comments
Open

fatal error: proj.h: No such file or directory #2

lithium555 opened this issue Nov 8, 2023 · 0 comments

Comments

@lithium555
Copy link

Hi!
I have such error:

go build cmd/main.go
# github.com/omniscale/go-proj/v2
/root/go/pkg/mod/github.com/omniscale/go-proj/[email protected]/proj.go:47:11: fatal error: proj.h: No such file or directory
 // #include <proj.h>
           ^~~~~~~~
compilation terminated.

First of all we need to install PROJ library:

sudo apt-get update
sudo apt-get install libproj-dev


root@2cabef130881:/app/src# apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease [83.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
Fetched 261 kB in 1s (205 kB/s)                             
Reading package lists... Done
root@2cabef130881:/app/src# apt-get install libproj-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libproj-dev is already the newest version (4.9.3-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

After that we should find out file proj.h in our system. We should write a command find / -name proj.h 2>/dev/null, but I have no results after that. Typically the proj.h file is located in the /usr/include directory
But he's not there...

If the proj.h file is available, then in our case, go-proj should know about the presence of the PROJ library. This is usually configured through the CGO_CFLAGS and CGO_LDFLAGS environment variables.

In theory it should be:

export CGO_CFLAGS="-I/usr/include"
export CGO_LDFLAGS="-L/usr/lib"

In my code I use import "github.com/omniscale/go-proj/v2" maybe we should write comething new in library ?

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

No branches or pull requests

1 participant