-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
MinGW build problems #1878
Comments
The mbedTLS link problems are because those libraries are not expressing the need to include the relevant libraries. I don't think it's right for me to add those here for NNG. Rather they should be fixed in Mbed TLS itself. Which version of Mbed TLS are you using? Note also that using MinGW has always had a point of friction, because that toolchain frequently lags the official Microsoft APIs. Our efforts to support that are limited to "best effort only". |
As I noted in the "Environment Details" section, I cloned Mbed TLS from its GitHub repo, and it was current as of 3 Oct. It doesn't look to me as though this is a problem with the MinGW environment:
But I did determine that these linking problems don't occur if a shared version of the Mbed TLS library is built. The default build instructions for Mbed TLS build only the static library. Using:
for the Mbed TLS library, and then
works fine. I think it's worth a note that a shared version of the Mbed TLS library should be built. That's probably true for Linux, as well. There's still the problem listed initially as item 2 - it's not documented that CancelIoEx works with a socket pointer for a HANDLE, AFAIK. |
As far as CancelIoEx, it works. And if it doesn't we have nothing else we can do. There isn't any other API available to us. |
WRT to the link libraries -- the Mbed package is meant to provide a definition of the targets that should include a list of any of its dependencies. That list can be different for static vs dynamic builds. The decision as to static vs dynamic for these libraries is entirely up to the library consumer. There are valid arguments for static, and there are valid arguments for dynamic. |
Just a note I was building 1.9.0 with msvc and it doesn't seem to be compiling even on native compiler?
Shouldn't there be explicit cast? |
Yeah that seems like a mistake. |
I saw someone already cherry picked changes and merged it into stable branch so it is all good |
I ran into 3 problems building on MinGW:
I'm not convinced that the CancelIoEx() function will work with a SOCKET argument. I don't see any mention of it in the MSDN doc for that function. There is a note on StackOverflow indicating that it works if WSA_FLAG_OVERLAPPED is used to create the socket.
My fix was simply to typecast to SOCKET
** Environment Details **
nng version: GitHub repo as of 3 Oct 2024
MSYS_NT-10.0-22631 3.4.10.x86_64 2023-12-22 10:06 UTC x86_64 Msys
gcc.exe (Rev1, Built by MSYS2 project) 14.2.0
cmake version 3.28.1
mbedtls: GitHub repo as of 3 Oct 2024
Additional context
build command: cmake -G Ninja -DNNG_ENABLE_TLS=ON -DNNG_TLS_ENGINE=mbed ..
I'm not sure without a lot more study of 'nng' of what the correct fixes would be. But I have a build now. And all the tests pass.
The text was updated successfully, but these errors were encountered: