I have a program using mictohttpd that works very well on a 64 bit
Linux PC, but I am having a devil of a time with mictohttpd in my
attempt to port this program to a gnu-linux-eabihf platform. I get the
same error when calling MHD_create_response_from_callback(), whether I
use a precompiled gnu-linux-eabihf libmicrohttpd.a or, whether I build
it myself on the Arm platform:
error: invalid conversion from ‘long int (*)(void*, uint64_t, char*,
size_t) {aka long int (*)(void*, long long unsigned int, char*, unsigned
int)}’ to ‘MHD_ContentReaderCallback {aka int (*)(void*, long long
unsigned int, char*, unsigned int)}’ [-fpermissive]
It would appear there is a problem on the armhf with the
MHD_ContentReaderCallback function passed as a parameter to
MHD_create_response_from_callback() returning a long int instead of a
type ssize_t as per its prototype. It appears that in the LinuxPC
version, ssize_t was equivalent to a long int, whereas, on the armhf
version, it is equivalent to an int.
However, changing the MHD_ContentReaderCallback function to return an
int or a ssize_t results in a ton of “undefined reference to `MHD_xxx'”
errors.
I should also mention that the MHD_create_response_from_callback()
declaration in microhttpd.h displays this obscure error:
initializing argument 3 of ‘MHD_Response*
MHD_create_response_from_callback(uint64_t, size_t,
MHD_ContentReaderCallback, void*, MHD_ContentReaderFreeCallback)’
[-fpermissive]
At my wits' end...
- [libmicrohttpd] Problems with libmicrohttpd.a on a gnu_... Bob Furber
-