I tied using ioctl on a socket in my project. It compiles, but can't find the symbol on the link. I searched the examples directory to see if any example uses ioctl, but no. So I replaced ioctl with lwip_ioctl_r and it compiles/links. Not sure if this is the right function. And not sure why ioctl isn't found.
John A
Anyone used ioctl?
Re: Anyone used ioctl?
Looking at the man page for ioctl() found here:
http://man7.org/linux/man-pages/man2/ioctl.2.html
It requires a #include <sys/ioctl.h>
This seems to be resolved in ESP-IDF from this file:
https://github.com/espressif/esp-idf/bl ... ys/ioctl.h
http://man7.org/linux/man-pages/man2/ioctl.2.html
It requires a #include <sys/ioctl.h>
This seems to be resolved in ESP-IDF from this file:
https://github.com/espressif/esp-idf/bl ... ys/ioctl.h
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Anyone used ioctl?
Yes, I have that include, which is probably why it compiles without a complaint. Unfortunately the linker is telling me it's not in the libs.
John A
John A
Re: Anyone used ioctl?
Are you including this file from a C++ source file, by chance? I see that the header file is missing exern C guards, which would cause linker issue as you describe. Try wrapping the include directive with an extern "C" block as a workaround.
Re: Anyone used ioctl?
Just tried it and that didn't help. But I tried declaring the function itself as extern "C" and then it showed up as a conflicting definition in lwipopts.h, and I found another include was including that first that I should have wrapped with an extern "C". Whew! Thanks.
John A
John A
Who is online
Users browsing this forum: No registered users and 120 guests