Closed mattfelsen closed 9 years ago
What unresolved symbols? Also, does it seem like you still need to define the _WIN32_WINNT? That was going to be my suggestion, but seeing that OF took out its defines of it.
I think you don't want the "shared" one. Maybe the libs path is being weird?
Not sure on the preprocessor def, but I'm seeing the same thing with & without it. The lib paths look good & it's finding the x64 libs fine.
The unresolved symbols don't actually look LWS related, more like VS stuff: unresolved external symbol impvsnprintf referenced in function __lws_log unresolved external symbol imp__iob_func referenced in function _lwsl_emit_stderr
If the websockets_shared.lib & .exp aren't needed, can we remove them from the repo to avoid confusion? I can pull them out in my PR.
Woah, weird. Googling around, those should be included from <wtypes.h>
, a windows include. With those things, it's sometimes a conflicting define somewhere...
Let me know how that looks, can dig into it myself a little later. Try that preprocessor def, see if that works/helps! (the 501, not 500)
I think part of your post got formatted out...which file were you talking about including?
Oh weird, just fixed it. It's not included explicitly anyways, one of those nice cascading system includes (probably from winsock2.h or windows.h). You should have to include it... It also could be an issue with which headers we are or aren't including from libwebsockets. I think the logger is new from the last version we were working with, for example.
I just tried the libs from @armadillu's fork - they work fine, no #include <wtypes.h>
, no preprocessor definitions. Would you be opposed to just included his updated binaries, assuming they were compiled with OpenSSL?
Meant to mention that wtypes.h
didn't help -- actually started getting tons of errors about redefintions/conflicts, with both the 501 and 500 preprocessor defs and without it.
Yeah of course! I haven't been working on Windows in a bit, trust that you homies know what you're doing :)
Just make sure it works with the PG folder structure. Thanks for leading the charge on this, dude!
Matt, are u seeing crashes on win? There definitely are some race condition issues on the thread creation destruction; What's on my my for works for OS X and Win for me (mostly), but I'm pretty sure this is very HW dependent. Also, still getting some crashes (around 5%) of the time when closing sockets on win
Yikes, ok. I'll do some testing with the examples before committing your binaries. Did you compile in openssl, by the way?
@armadillu You think that's in lws or in my code? It's been really stable on OS X, but I haven't used it as extensively on Windows.
I would say it's the addon code; but hard to tell 100%. I think thread spawn times are very different on windows and OSX; and they also change a lot across different hardware.
This (https://github.com/armadillu/ofxLibwebsockets/commit/3d7341a005dfcdedf5c28c209add99601d0824aa) made connections work for me on a MS Surface tablet; without it connections just never happened.
They would only happen when I set ofSetLogLevel(OF_LOG_VERBOSE)... That's what lead me to add some random sleeps in there to make it work; but it's obviously a dodgy patch. Will have a deeper look when I have some free time; I just needed it to work for a client demo at the time.
@mattfelsen I can't remember; It was fairly easy with c+make... I can see if I still have the .vcproj if it helps.
Hm, that's super weird! I see what you're thinking, though, with the sleeps. I'll have to dig into the library and see if there's a check we can do to create a lock until we know if the context is made or not.
Looking at their examples, they just go for it: https://github.com/warmcat/libwebsockets/blob/master/test-server/test-client.c
They do a much shorter wait time on the libwebsocket_service call, though... That could be the culprit? https://github.com/labatrockwell/ofxLibwebsockets/blob/de8b21fdc4007b9a7c76dd329b912463dbde2f1f/libs/ofxLibwebsockets/src/Client.cpp#L256
For anyone coming across this, there is a pending PR which addresses this issue https://github.com/labatrockwell/ofxLibwebsockets/pull/63
Ran into this while playing with my new changes. If I use the commandLine pg to make a project, make sure the libs for Win32 match how they were in addon_config.mk (i.e. websockets.lib and zlib_internal.lib), and add the preprocessor definition, I get unresolved symbols when trying to compile. If I add websockets_shared.lib, specifically before websockets.lib rather than after, it will compile but complain about not finding websockets_shared.dll when launching. I assume this was working for you before when you originally created the libs in b05d7d9545c64e46fd436577175da4020759e393?