Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with httpd? during build and compile #527

Open
earlobeheard opened this issue Mar 31, 2021 · 2 comments
Open

error with httpd? during build and compile #527

earlobeheard opened this issue Mar 31, 2021 · 2 comments

Comments

@earlobeheard
Copy link

Erics-iMac:xmr-stak-cpu-master folderhub$ sudo make install
Consolidate compiler generated dependencies of target xmr-stak-c
[ 38%] Built target xmr-stak-c
Consolidate compiler generated dependencies of target xmr-stak-cpu
[ 44%] Building CXX object CMakeFiles/xmr-stak-cpu.dir/httpd.cpp.o
/Users/folderhub/Downloads/xmr-stak-cpu-master/httpd.cpp:133:6: error: no matching
function for call to 'MHD_start_daemon'
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION,
^~~~~~~~~~~~~~~~
/usr/local/include/microhttpd.h:2440:1: note: candidate function not viable: no
known conversion from 'int (*)(void *, MHD_Connection *, const char *, const
char *, const char *, const char *, size_t , void **)' (aka 'int ()(void *,
MHD_Connection *, const char *, const char *, const char *, const char *,
unsigned long , void **)') to 'MHD_AccessHandlerCallback' (aka 'MHD_Result
(
)(void *, MHD_Connection *, const char *, const char *, const char *, const
char *, unsigned long *, void **)') for 5th argument
MHD_start_daemon (unsigned int flags,
^
1 error generated.
make[2]: *** [CMakeFiles/xmr-stak-cpu.dir/httpd.cpp.o] Error 1
make[1]: *** [CMakeFiles/xmr-stak-cpu.dir/all] Error 2
make: *** [all] Error 2
Erics-iMac:xmr-stak-cpu-master folderhub$

@bcheeves
Copy link

bcheeves commented Apr 6, 2021

this is some type of failure that was introduced with the release of libmicrohttpd 0.9.71 it looks like. See also:
fireice-uk/xmr-stak#2701

@bcheeves
Copy link

bcheeves commented Apr 6, 2021

similar problem reported in the Ola open-source project:
OpenLightingProject/ola#1672

one user reported success with installing libmicrohttpd using macports instead of home-brew, and then replacing the microhttpd header file with this one:
https://github.com/scottjg/libmicrohttpd/blob/master/src/include/microhttpd.h

this seems like something that xmr-stak dev team would need to patch, if I'm not mistaken, since the upstream changes in libmicrohttpd broke this. I tried taking the latest microhttpd.h file from the upstream GNU linux project page directly:
https://git.gnunet.org/libmicrohttpd.git/tree/src/include/microhttpd.h
which also failed

fireice-uk/xmr-stak#2685

UPDATE: found this merge request where it looks like a fix was already checked into another branch:
fireice-uk/xmr-stak#2688
fireice-uk/xmr-stak#2689

Fix is here:
fireice-uk/xmr-stak@f2770a7

I can confirm that if I download the following two files:
https://github.com/fireice-uk/xmr-stak/blob/f2770a767f0b288dde00b04aca68c77ceaf8055e/xmrstak/http/httpd.cpp
https://github.com/fireice-uk/xmr-stak/blob/f2770a767f0b288dde00b04aca68c77ceaf8055e/xmrstak/http/httpd.hpp
and save them to the ./xmr-stak/xmrstak/http/ directory

I am them able to compile successfully with just a warning generated here:
[ 23%] Built target xmr-stak-c Consolidate compiler generated dependencies of target xmr-stak-backend [ 25%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o /Users/benners/xmr-stak/xmrstak/http/httpd.cpp:79:10: warning: result of comparison of constant -1 with expression of type 'MHD_Result' is always false [-Wtautological-constant-out-of-range-compare] if(ret == MHD_INVALID_NONCE || ret == MHD_NO) ~~~ ^ ~~~~~~~~~~~~~~~~~ /Users/benners/xmr-stak/xmrstak/http/httpd.cpp:82:94: warning: result of comparison of constant -1 with expression of type 'MHD_Result' is always false [-Wtautological-constant-out-of-range-compare] ret = MHD_queue_auth_fail_response(connection, sHttpAuthRealm, sHttpAuthOpaque, rsp, (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO); ~~~ ^ ~~~~~~~~~~~~~~~~~ 2 warnings generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants