eulerto / wal2json

JSON output plugin for changeset extraction
BSD 3-Clause "New" or "Revised" License
1.33k stars 161 forks source link

PG 11 when run make: 'stdio.h' file not found #103

Closed svv2014 closed 5 years ago

svv2014 commented 5 years ago

Hello,

On Mac after updating my Postgres 10 to 11 with brew I'm having trouble with wal2json. I cannot make it work again. Using previously compiled version I'm getting error

ERROR: could not load library "/usr/local/lib/postgresql/wal2json.so": dlopen(/usr/local/lib/postgresql/wal2json.so, 10): Symbol not found: _AllocSetContextCreate
  Referenced from: /usr/local/lib/postgresql/wal2json.so
  Expected in: /usr/local/opt/postgresql/bin/postgres
 in /usr/local/lib/postgresql/wal2json.so

And when I'm trying to compile a new one there is another error:

USE_PGXS=1 make install
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  -I. -I./ -I/usr/local/Cellar/postgresql/11.1_1/include/server -I/usr/local/Cellar/postgresql/11.1_1/include/internal -I/usr/local/Cellar/icu4c/63.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2   -c -o wal2json.o wal2json.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' [-Wmissing-sysroot]
In file included from wal2json.c:13:
In file included from /usr/local/Cellar/postgresql/11.1_1/include/server/postgres.h:46:
/usr/local/Cellar/postgresql/11.1_1/include/server/c.h:59:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make: *** [wal2json.o] Error 1

I'm not sure what to do so any suggestions would be much appreciated!

Thanks.

svv2014 commented 5 years ago

Ok, problem solved.

I downloaded latest Xcode-beta unpacked it and moved to /Applications/Xcode.app make works fine now.