Closed mixmind closed 3 years ago
@mixmind Thanks for reaching out!
Windows is currently not supported for pg_query, which is why you are getting this error.
The parent issue tracking this is https://github.com/pganalyze/libpg_query/issues/44 -- note that there are no immediate plans to add this support, but feel free to subscribe to that issue for updates.
Closing this per the earlier comment - please track the libpg_query issue for updates.
Hi,
I'm trying to use this library and compile it to windows from Ubuntu 20. When I'm compiling it I have an error:
# github.com/pganalyze/pg_query_go/v2/parser In file included from ../../go/pkg/mod/github.com/pganalyze/pg_query_go/v2@v2.0.2/parser/include/c.h:1318, from ../../go/pkg/mod/github.com/pganalyze/pg_query_go/v2@v2.0.2/parser/include/postgres.h:46, from pg_query_internal.h:4, from pg_query.c:2: ../../go/pkg/mod/github.com/pganalyze/pg_query_go/v2@v2.0.2/parser/include/port.h:17:10: fatal error: netdb.h: No such file or directory 17 | #include <netdb.h> | ^~~~~~~~~
Compile command for example:
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -o /bin/file ./cmd/file
From some google search i found that it's talking about that file that already exists:
ls -l /usr/include/rpc/netdb.h
-rw-r--r-- 1 root root 2897 Dec 16 2020 /usr/include/rpc/netdb.h
What I'm doing wrong? Please help