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

Having difficulty building on windows with "redefinition of 'struct timespec #1

Open
thnass opened this issue Jan 2, 2016 · 2 comments

Comments

@thnass
Copy link

thnass commented Jan 2, 2016

make ended with 2 errors, using "-DHAVE_STRUCT_TIMESPEC" in the CFLAGS removes the first error but don't think it's the best and it seems i'm missing some corresponding header files somewhere. Can you please point out what i'm doing wrong and please help me fix them, thanks

Make ended with 2 errors.

" CC nsgminer-miner.o
In file included from compat.h:32:0,
from miner.c:57:
c:\mingw\include\pthread.h:320:8: error: redefinition of 'struct timespec'
struct timespec {
^
In file included from c:\mingw\include\unistd.h:95:0,
from miner.c:29:
c:\mingw\include\parts\time.h:65:8: note: originally defined here
struct timespec
^
In file included from miner.c:57:0:
compat.h:90:19: error: conflicting types for 'nanosleep'
static inline int nanosleep(const struct timespec req, struct timespec *rem)
^
In file included from miner.c:29:0:
c:\mingw\include\unistd.h:109:5: note: previous definition of 'nanosleep' was h
re
int nanosleep( const struct timespec *period, struct timespec *residual )
^
In file included from miner.c:57:0:
compat.h:122:19: error: conflicting types for 'sleep'
static inline int sleep(unsigned int secs)
^
In file included from miner.c:29:0:
c:\mingw\include\unistd.h:142:10: note: previous definition of 'sleep' was here
unsigned sleep( unsigned period ){ return __mingw_sleep( period, 0 ); }
^
make[2]: *
* [nsgminer-miner.o] Error 1"

@ghostlander
Copy link
Owner

#if !(__MINGW64__)

MinGW64 defines nanosleep() and sleep(), MinGW32 doesn't usually. If your version comes with these, replace MINGW64 with MINGW32 until a universal solution comes up.

@akkida746
Copy link

I got the same error in Ecliepse Neon IDE and i resolved it by adding '-DHAVE_STRUCT_TIMESPEC' in C/C++ Build -> Settings -> GCC C++ Compiler -> Miscellaneous -> Others flag

redefinition of struct timespec

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

3 participants