1

I have already installed geos library using brew install geos, but I'm still getting following error on mac M1.

./geos.h:1:10: fatal error: 'geos_c.h' file not found
#include <geos_c.h>
         ^~~~~~~~~~
1 error generated.

3
  • Have you -I<path_to_goes_headers> on the compile line? Commented Feb 9, 2022 at 11:10
  • I am not actually directly compiling this file. This error is occurring when I run a make command on large project I am working at my organization. The make command runs following. go mod download, go mod vendor, GO111MODULE=on go get github.com/golang/mock/[email protected], go generate ./... and finally go test -cover ./.... Should I provide any other information. Thanks for helping. Commented Feb 9, 2022 at 11:16
  • Hi @RuchitPatel were you able to solve this problem ?
    – user818117
    Commented Mar 29, 2022 at 5:30

1 Answer 1

5

I believe it is because brew doesn't install the header packages. You can build from source. This is what I did to solve it:

brew install wget

wget http://download.osgeo.org/geos/geos-3.3.8.tar.bz2

tar -xvf geos-3.3.8.tar.bz2

And run ./configure, make, and sudo make install in the extracted directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.