[Libwebsockets] Compiling in Visual Studio

Andy Green andy at warmcat.com
Thu Feb 28 22:50:50 CET 2013

Hi -

Fixing Windows build (as in path issue) is a bit difficult for me anyway since I din't use Windows, but particularly atm since I am travelling.  If Joakim has a spare minute that'd be great otherwise I'll look at it in some hours.

The eagain thing that code is anyway kind of suspicious.  Your fix is fine though.

Shortly I plan to remove the autotools stuff in favour of cmake.  I was able to cut down Joakim's cmake stuff for the json parser project and figure enough of it out to be workable.


FNA <aqiruse at gmail.com> wrote:

>In regards to:
>tag name         v1.22-chrome26-firefox18
>Tagged object  commit
>I have used the CMake file to generate my project files for Visual
>2008. The CMake works great. However, there are two issues. One issue
>with the paths that the generated project files have set by CMake. They
>specify lib\Debug\websockets_static.lib as the library location but the
>test projects are unable to find that path. Simple fix by adding my
>dir to before the lib, I do not mind manually doing that.
>Secondly, which is a problem is located in the server.c file on line
>The line reads:
>if (errno == EAGAIN || errno == EWOULDBLOCK) {
>EWOULDBLOCK is not defined and not known for Visual Studio. Therefore
>order to provide a fix for this, it is simply at the top of the file in
>defines, change the defines for WIN32 in server.c to read:
>#ifdef WIN32
>#include <tchar.h>
>#include <io.h>
>#if _MSC_VER > 1000 //add this
>#define EWOULDBLOCK WSAEWOULDBLOCK //Add this to work with MS Visual
>#endif //end of _MSC_VER
>Apart from that it compiles fine. I have not tested it yet, but it is a
>stable version so I am sure it will work fine as well.
>--A programmer started to cuss
>--Because getting to sleep was a fuss
>--As he lay there in bed
>--Looping 'round in his head
>--was: while( !asleep() ) sheep++;
>--Nothing is impossible! It is merely a matter of figuring out How?
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20130301/05962f3f/attachment-0001.html>

More information about the Libwebsockets mailing list