supabase / pg_net

A PostgreSQL extension that enables asynchronous (non-blocking) HTTP/HTTPS requests with SQL
https://supabase.github.io/pg_net
Apache License 2.0
213 stars 16 forks source link

i can not compile pg_net on centos #101

Closed yuripean closed 4 months ago

yuripean commented 1 year ago

hello i can not compile my pg_net plugin on centos 7 how i can do when i compile this error appear

my curl version is

curl --version
curl 8.2.1 (x86_64-pc-linux-gnu) libcurl/8.2.1 zlib/1.2.7
Release-Date: 2023-07-26
Protocols: dict file ftp gopher http imap mqtt pop3 rtsp smtp telnet tftp
Features: alt-svc AsynchDNS IPv6 Largefile libz UnixSockets
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-15/include/server -I/usr/pgsql-15/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/util.o src/util.c
src/util.c: In function ‘_encode_url_with_params_array’:
src/util.c:25:5: error: unknown type name ‘CURLU’
     CURLU *h = curl_url();
     ^
src/util.c:25:5: warning: implicit declaration of function ‘curl_url’ [-Wimplicit-function-declaration]
src/util.c:25:16: warning: initialization makes pointer from integer without a cast [enabled by default]
     CURLU *h = curl_url();
                ^
src/util.c:26:5: error: unknown type name ‘CURLUcode’
     CURLUcode rc;
     ^
src/util.c:37:5: warning: implicit declaration of function ‘curl_url_set’ [-Wimplicit-function-declaration]
     rc = curl_url_set(h, CURLUPART_URL, url, 0);
     ^
src/util.c:37:26: error: ‘CURLUPART_URL’ undeclared (first use in this function)
     rc = curl_url_set(h, CURLUPART_URL, url, 0);
                          ^
src/util.c:37:26: note: each undeclared identifier is reported only once for each function it appears in
src/util.c:38:15: error: ‘CURLUE_OK’ undeclared (first use in this function)
     if (rc != CURLUE_OK) {
               ^
src/util.c:49:30: error: ‘CURLUPART_QUERY’ undeclared (first use in this function)
         rc = curl_url_set(h, CURLUPART_QUERY, param, CURLU_APPENDQUERY);
                              ^
src/util.c:49:54: error: ‘CURLU_APPENDQUERY’ undeclared (first use in this function)
         rc = curl_url_set(h, CURLUPART_QUERY, param, CURLU_APPENDQUERY);
                                                      ^
src/util.c:57:5: warning: implicit declaration of function ‘curl_url_get’ [-Wimplicit-function-declaration]
     rc = curl_url_get(h, CURLUPART_URL, &full_url, 0);
     ^
src/util.c:63:5: warning: implicit declaration of function ‘curl_url_cleanup’ [-Wimplicit-function-declaration]
     curl_url_cleanup(h);
     ^
make: *** [src/util.o] Error 1
soedirgo commented 1 year ago

Do you have libcurl installed?

steve-chavez commented 1 year ago

@yuripean Try yum install libcurl-devel.

https://stackoverflow.com/questions/69633205/libcurl-c-how-to-correctly-install-and-use-on-centos-7

TheOtherBrian1 commented 1 year ago

@yuripean Hi, I just wanted to see if your issue was resolved. If so, I'd like to know so we can update the docs to help others.