sgminer-dev / sgminer

Scrypt GPU miner
GNU General Public License v3.0
633 stars 825 forks source link

MinGW make error #458

Closed Epiger closed 6 years ago

Epiger commented 7 years ago

I tried to build sgminer on Windows with MinGW but in the making process it throws some Errors I used the MinGW branch

make[2]: Entering directory '/home/wigo1/sgminer-build-mingw'
  CC     sgminer-sgminer.o
In file included from ./miner.h:29:0,
                 from ./sha2.h:36,
                 from sgminer.c:49:
./util.h: In function 'sock_blocks':
./util.h:48:59: error: 'EAGAIN' undeclared (first use in this function)
   return (WSAGetLastError() == WSAEWOULDBLOCK || errno == EAGAIN);
                                                           ^~~~~~
./util.h:48:59: note: each undeclared identifier is reported only once for each function it appears in
./util.h: In function 'sock_timeout':
./util.h:52:57: error: 'ETIMEDOUT' undeclared (first use in this function)
   return (WSAGetLastError() == WSAETIMEDOUT || errno == ETIMEDOUT);
                                                         ^~~~~~~~~
./util.h: In function 'interrupted':
./util.h:56:53: error: 'EINTR' undeclared (first use in this function)
   return (WSAGetLastError() == WSAEINTR || errno == EINTR);
                                                     ^~~~~
sgminer.c: In function 'kill_mining':
sgminer.c:3318:11: error: invalid operands to binary && (have 'int' and 'pthread_t {aka struct <anonymous>}')
   if (pth && *pth)
       ~~~ ^~ ~~~~
make[2]: *** [sgminer-sgminer.o] Error 1
make[2]: Leaving directory '/home/wigo1/sgminer-build-mingw'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/wigo1/sgminer-build-mingw'
make: *** [all] Error 2 

GCC version gcc.exe (MinGW.org GCC-6.3.0-1) 6.3.0 https://github.com/sgminer-dev/sgminer/blob/0e7fd54c0fb7a51784a8d31c7f72ef87c7d5ce33/sgminer.c#L3318 https://github.com/sgminer-dev/sgminer/blob/0e7fd54c0fb7a51784a8d31c7f72ef87c7d5ce33/util.h#L48