cpuminer-multi icon indicating copy to clipboard operation
cpuminer-multi copied to clipboard

Compile Error

Open nikhiljha opened this issue 8 years ago • 2 comments

In file included from miner.h:9:0,
                 from cpu-miner.c:42:
c:\mingw\include\pthread.h:320:8: error: redefinition of 'struct timespec'
 struct timespec {
        ^
In file included from c:\mingw\include\unistd.h:96:0,
                 from cpu-miner.c:19:
c:\mingw\include\parts\time.h:105:8: note: originally defined here
 struct timespec
        ^
cpu-miner.c: In function 'miner_thread':
cpu-miner.c:1061:70: error: 'MEM_LARGE_PAGES' undeclared (first use in this function)
   persistentctx = VirtualAlloc(NULL, sizeof(struct cryptonight_ctx), MEM_LARGE_PAGES, PAGE_READWRITE);
                                                                      ^
cpu-miner.c:1061:70: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [minerd-cpu-miner.o] Error 1

Not sure what this means

nikhiljha avatar Jul 08 '16 16:07 nikhiljha

I added the -D-HAVE-TIMESPECS flag. (by the way I'm on Mingw for windows 32 bit.)

Now I have this error:

 || echo './'`cpu-miner.c
cpu-miner.c: In function 'miner_thread':
cpu-miner.c:1061:70: error: 'MEM_LARGE_PAGES' undeclared (first use in this function)
   persistentctx = VirtualAlloc(NULL, sizeof(struct cryptonight_ctx), MEM_LARGE_PAGES, PAGE_READWRITE);

nikhiljha avatar Jul 08 '16 16:07 nikhiljha

Messed around with it some more and now I have

cpu-miner.c: In function ‘miner_thread’:
cpu-miner.c:1056:139: error: ‘MAP_HUGETLB’ undeclared (first use in this function)
   persistentctx = (struct cryptonight_ctx *)mmap(0, sizeof(struct cryptonight_ctx), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
                                                                                                                                           ^
cpu-miner.c:1056:139: note: each undeclared identifier is reported only once for each function it appears in
cpu-miner.c:1056:153: error: ‘MAP_POPULATE’ undeclared (first use in this function)
   persistentctx = (struct cryptonight_ctx *)mmap(0, sizeof(struct cryptonight_ctx), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_POPULATE, 0, 0);
                                                                                                                                                         ^
cpu-miner.c:1058:88: error: ‘MADV_HUGEPAGE’ undeclared (first use in this function)
   madvise(persistentctx, sizeof(struct cryptonight_ctx), MADV_RANDOM | MADV_WILLNEED | MADV_HUGEPAGE);

nikhiljha avatar Jul 08 '16 23:07 nikhiljha