LUX-Core / rx2-cpuminer

rx2 cpu miner
Other
7 stars 5 forks source link

Linux Build Error "unknown type name SC_HANDLE" on Ubuntu 20.04 #10

Open cniweb opened 3 years ago

cniweb commented 3 years ago

On a Ubuntu 20.04 system:

gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

I get an error:

make  all-recursive
make[1]: Entering directory '/opt/rx2-cpuminer'
Making all in compat
make[2]: Entering directory '/opt/rx2-cpuminer/compat'
Making all in bos-jansson
make[3]: Entering directory '/opt/rx2-cpuminer/compat/bos-jansson'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/opt/rx2-cpuminer/compat/bos-jansson'
make[3]: Entering directory '/opt/rx2-cpuminer/compat'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/opt/rx2-cpuminer/compat'
make[2]: Leaving directory '/opt/rx2-cpuminer/compat'
make[2]: Entering directory '/opt/rx2-cpuminer'
gcc -DHAVE_CONFIG_H -I.  -static -fno-strict-aliasing -std=gnu++11  -Iyes/include -Iyes/include -fno-strict-aliasing -I./compat/bos-jansson -I. -Iyes/include -Iyes/include -static -Wno-pointer-sign -Wno-pointer-to-int-cast  -g   -march=native  -Iyes/include -Iyes/include -MT cpuminer-cpu-miner.o -MD -MP -MF .deps/cpuminer-cpu-miner.Tpo -c -o cpuminer-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
cc1: warning: command line option ‘-std=gnu++11’ is valid for C++/ObjC++ but not for C
In file included from cpu-miner.c:40:
/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
   21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."
      |  ^~~~~~~
In file included from cpu-miner.c:48:
miner.h:409:8: error: unknown type name ‘SC_HANDLE’
  409 | static SC_HANDLE hManager;
      |        ^~~~~~~~~
miner.h:410:8: error: unknown type name ‘SC_HANDLE’
  410 | static SC_HANDLE hService;
      |        ^~~~~~~~~
miner.h:411:8: error: unknown type name ‘HANDLE’
  411 | static HANDLE hDriver;
      |        ^~~~~~
make[2]: *** [Makefile:1563: cpuminer-cpu-miner.o] Error 1
make[2]: Leaving directory '/opt/rx2-cpuminer'
make[1]: *** [Makefile:3462: all-recursive] Error 1
make[1]: Leaving directory '/opt/rx2-cpuminer'
make: *** [Makefile:782: all] Error 2

What can I do against it?

musicislife08 commented 3 years ago

I get the same on 20.10. Not sure what the issue is

BeaconStudio4 commented 3 years ago

I was able to compile past that by editing the MSR section of miner.h and rem'd out: static SC_HANDLE hManager; static SC_HANDLE hService; static HANDLE hDriver;

These appear to be Windows compiler settings for service manager. Not sure why the makefile is not taking care of this.

Still chasing Alice... Looks like I'm just reverting to the prior commit: https://github.com/LUX-Core/rx2-cpuminer/tree/97b30645aa6efc3e092faee7ac3e9c14c82babe5

I recommend pulling the prior commit. I was able to rem lines 47 and 48 in rx2_algo.cpp, as well as all MSR references in cpu-miner.c. It built and ran, will test with a pool/wallet, but it breaks the intent for cross platform compiling.

djm34 commented 3 years ago

these "HANDLE" are for windows only, forgot to put an exception. Will correct that. For the time being, for linux use the previous release and to use MSR you just need to set parameter in bash file