-
Notifications
You must be signed in to change notification settings - Fork 20
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
nanonng 0.21.9 build issue with MinGW-w64 MSVCRT #922
Comments
thats why i labled it as a pre-release, you know. Will discuss with Garrett on it. |
related to nanomsg/nng#1826 |
Sorry to hear that. I'm offering the solution on a plate here . If it doesn't get incorporated I guess will just keep patching my builds. Just trying to help - as an open source developer. |
But we definitely could figure it out in NanoNNG fork. |
Tried with your way works. I am using Win10 with MinGW |
@JaylinYu The issue is specifically with MSVCRT toolchain, if you're using UCRT the issue will not happen. |
When building nanonng version 0.21.9 for Windows with an MSVCRT MinGW-w64 toolchain the build fails in
src/platform/windows/win_clock.c
becausetimespec_get()
is not defined (it does exist in UCRT MinGW-w64).The solution is to modify
nni_time_get()
insrc/platform/windows/win_clock.c
to only use thetimespec_get()
implementation when building against UCRT (using#ifdef _UCRT
) and otherwise fall back to another implementation, for example the same fallback based ingettimeofday()
used insrc/platform/posix/posix_clock.c
.On a side note, the line
int rv;
innni_time_get()
insrc/platform/windows/win_clock.c
is unused.I was able to build when after modifying
nni_time_get()
insrc/platform/windows/win_clock.c
as follows:Note that I haven't tested it yet, and maybe there is a better way (with a more granular clock) to do this.
The text was updated successfully, but these errors were encountered: