fireice-uk / xmr-stak-cpu

Monero CPU miner
GNU General Public License v3.0
1.11k stars 478 forks source link

error with httpd? during build and compile #527

Open earlobeheard opened 3 years ago

earlobeheard commented 3 years ago

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 commented 3 years ago

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

bcheeves commented 3 years ago

similar problem reported in the Ola open-source project: https://github.com/OpenLightingProject/ola/issues/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

https://github.com/fireice-uk/xmr-stak/issues/2685

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

Fix is here: https://github.com/fireice-uk/xmr-stak/pull/2688/commits/f2770a767f0b288dde00b04aca68c77ceaf8055e

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.`