[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.

-Andy

FNA <aqiruse at gmail.com> wrote:

>In regards to:
>tag name         v1.22-chrome26-firefox18
>Tagged object  commit
>c2bb3dc7b3...<http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=c2bb3dc7b399c321123ad98bbfc77c857f35998e>
>download
>libwebsockets-1.22-chrome26-firefox18.tar.gz<http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/snapshot/libwebsockets-1.22-chrome26-firefox18.tar.gz>
>
>I have used the CMake file to generate my project files for Visual
>Studio
>2008. The CMake works great. However, there are two issues. One issue
>is
>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
>project
>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
>221.
>The line reads:
>
>if (errno == EAGAIN || errno == EWOULDBLOCK) {
>
>
>EWOULDBLOCK is not defined and not known for Visual Studio. Therefore
>in
>order to provide a fix for this, it is simply at the top of the file in
>the
>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
>Studio
>#endif //end of _MSC_VER
>#else
>
>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
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
-------------- 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