esp32-snippets icon indicating copy to clipboard operation
esp32-snippets copied to clipboard

Build error: Implicit declaration of function socketpair

Open simonerom opened this issue 4 years ago • 0 comments

Hi there, I've watched the great video from @nkolban and followed it step by step to build an esp32 app with libcurl.

Strangely, I'm getting this error when building after I copied the curl_config.h and component.mk files into my project folder as described in the video. This is weird as I see that @nkolban did actually solved it here back in 2017, yet it's still happening to me.

The only thing I noticed is that the video mentions a include/curl/buildcurl.h file that should be downloaded as well from the repository, but it's not there anymore (I assume it's non needed anymore...).

Anyone can help?

[CUT]
In file included from /Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multihandle.h:29,
                 from /Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/urldata.h:141,
                 from /Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multi.c:27:
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multi.c: In function 'Curl_multi_handle':
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/socketpair.h:30:34: error: implicit declaration of function 'socketpair'; did you mean 'socket'? [-Werror=implicit-function-declaration]
 #define Curl_socketpair(a,b,c,d) socketpair(a,b,c,d)
                                  ^~~~~~~~~~
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multi.c:385:6: note: in expansion of macro 'Curl_socketpair'
   if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, multi->wakeup_pair) < 0) {
      ^~~~~~~~~~~~~~~
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multi.c:385:22: error: 'AF_UNIX' undeclared (first use in this function); did you mean 'AF_INET'?
   if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, multi->wakeup_pair) < 0) {
                      ^~~~~~~
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/socketpair.h:30:45: note: in definition of macro 'Curl_socketpair'
 #define Curl_socketpair(a,b,c,d) socketpair(a,b,c,d)
                                             ^
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/multi.c:385:22: note: each undeclared identifier is reported only once for each function it appears in
   if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, multi->wakeup_pair) < 0) {
                      ^~~~~~~
/Users/simone/Source/github/simonerom/esp32-firmware/components/curl/lib/socketpair.h:30:45: note: in definition of macro 'Curl_socketpair'
 #define Curl_socketpair(a,b,c,d) socketpair(a,b,c,d)
                                             ^
cc1: some warnings being treated as errors
make[1]: *** [lib/multi.o] Error 1
make: *** [component-curl-build] Error 2

simonerom avatar Mar 01 '21 23:03 simonerom