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
Doesn't build on Windows with CMake + mingw32 #330
Comments
Would you mind replacing "ADDRESS_FAMILY" in win.h by "short" and reporting back whether it helped? |
It does, we're making progress. Not yet successful though:
|
What version of Windows is that, btw? |
Windows 8.1 + TDM-GCC. |
I'm getting build errors as well on Win7 but once I include limits.h it compiles :)
|
as for the Win 8.1 issue while I was fixing the build for mingw I had to specify a windows version as mingw seemed to not set that so [1]
[1] https://github.com/nanomsg/nanomsg/blob/master/CMakeLists.txt#L39 |
Can you make a patch for the limits.h thing? |
@zerotacg: tried removing |
removing the define would make it worse I assume you should set it to the correct version not sure which one that is for win8 though but still, I followed the _TRUNCATE and it is defined in _mingw.h which seems to be included from
I do not see any conditions that prevent it from being defined though, could you try and investigate why it does not get defined for you? |
kind of the same goes for your initial error as well which is defined in winsock2.h there seems to be no condition to prevent i from being defined for reference, I'm using mingw482_32 with qt |
An #undef maybe? |
seems not to be the case, maybe I'm just missing something |
I could build it without problems with my usual qt+mingw setup on a 8.1 vm I'll look into tdm later on and see if we can do something about it |
just a quick run on tdm gcc yields the same errors you get and it in there version of winsock2.h ADDRESS_FAMILY is not defined |
I've replaced ADDRESS_FAMILY by short in the mainline. |
the ADDRESS_FAMILY is just one symptom there are lots of other symbols not defined. I opened a bug on the tdm project [1] to try and get some information why it's missing. I wild guess would be they don't support newer/older/certain versions of windows api which nanomsg is using. While fixing cmake for mingw the first time around I noticed nanomsg requires vista and up, for example |
Thank you for checking this. The reason I'm using TDM-GCC is that I want to avoid mingw-related DLL dependencies. I know you can pass options to mingw to get static linking, but I have not found a way to achieve this consistently independently of the build system used (cmake, make, automaker, batch sripts...). |
Only thing that pops up when not compiling for vista is a linking error for CancelIoEx [1][2] not sure how to work around that and if there is anything else that is not compatible [1] https://github.com/nanomsg/nanomsg/blob/master/src/aio/usock_win.inc#L1034 |
I've played with CancelIo and CancelIoEx when implementing Windows port. You can replace one by another, but it looks like there's some kind of bug in CancelIo which doesn't occur with CancelIoEx. |
John from the tdm project mentions [1] that the used features are not available in the w32api version tdm is based on. You might be able to use an more up-to-date version of the w32api package/module in combination with tdm. It shouldn't be to hard to implement compatibility though. |
I believe this is fixed now. See bug #212 which addresses a build solution for this; the key components of which are now integrated. That said, this does not make this work on Windows XP. This is strictly a Cmake/mingw solution. |
I just tested with a fresh install of TDM-MinGW64 and latest CMake 3.40 and, sorry, but it don't work:
|
Argh. So mingw is problematic. Its this weird mutant that is neither Windows nor POSIX. Aargh. Its looks like I'm going to have to actually install this stupid beast to debug it properly, since I can't seem to get anyone else to provide reasonably correct PRs for it. Grrrr.... |
For what is worth, I moved to Visual Studio 2015.
|
Visual Studio was the right choice. I think its free, yes? |
The plain version yes, it is.
|
So we need to #include <stdio.h> for _sprintf_s on Windows. Finally it appears that we should be checking against NULL with lpOverlapped. That's a pointer. |
Ok, got those fixed, and went through all holy hell to get mingw compilation "working" on AppVeyor, only to discover that mingw is missing a bunch of stuff we need for Winsock. I'm throwing in the towel on this. Use Visual Studio. It's free. If someone wants to submit a PR that actually fixes these issues, I'm happy to take a look. But otherwise, my answer is "Use Visual Studio". (Or even better, use a POSIX platform -- Linux, Solaris, etc.) |
Closing as will-not-fix for now. |
The mingw version bundled with qt works [1] The API provided seems to be defined in the bundled w32api package [2] [1] https://ci.appveyor.com/project/zerotacg/nanomsg |
Here are the steps performed to reproduce the issue (version 0.4 beta):
The text was updated successfully, but these errors were encountered: