-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How to compile websocketpp examples for mingw using C++11 std::thread? #478
Comments
Does it compile with regular g++ on this system? defining |
It compiles fine with g++ and clang++ (4.8.4 and 3.6 resp.). I was looking in my mingw system headers, at
So, it looks like they just commented out this definition? That sounds rather suspicious to me but maybe I'm missing something... |
that would explain the error. I can't think of an obvious reason to do this. perhaps the mingw dev folks might have more insight? |
Yeah, I will ask them Edit: Posted to their issue tracker here: https://sourceforge.net/p/mingw-w64/support-requests/105/ |
Hi, so I fooled around with this some more, here is what I can report:
Then, I can compile both the utility client and the echo server using mingw g++ with Then all of these programs work and can interoperate, i.e., the g++ compiled echo server can talk to the mingw compiled utility client running in wine, etc., and this is without any mingw boost being available. So... modifying the libstdc++ header is not fun and I don't know if this is really "working" but at least it appears to work. Hopefully upstream can confirm this and make a patch I guess. |
It occurs to me now, the only better workaround I can think of that doesn't involve modifying system headers is, insert some code into |
Hi, I'm trying to compile websocketpp using stand-alone Asio transport-layer, C++11, and no boost in a cross-platform application. When I use just asio I can make simple http servers just fine, I have been using mingw's winpthread library.
When I tried to use websocketpp, I get problems because it assumes that mingw does not have
std::thread
, and wantsboost::thread
. I guess maybe some versions of mingw didn't support this and required work arounds like this, but current versions (mine from Ubuntu trusty standardi686-mingw32-w64-g++
package?) seems to have this.I therefore have been circumventing the code in
common/thread.hpp
by compiling with-D_WEBSOCKETPP_CPP11_THREAD_=1
in order to override its preference forboost::thread
on mingw.However, seemingly unrelated to this I get a bizarre compilation error:
I get this error when trying to build anything, in particular, the
utility_client.cpp
file.Can you advise what is the proper way to build the tutorial code on mingw, if possible using asio with C++11 threads and not boost::thread?
I made a simple repo to assist in reproducing my exact problem: https://github.com/cbeck88/wspp_mingw_test
I have also posted this question on stack overflow, since I'm really not sure if it means there is a problem with my toolchain.
Thanks for your time and attention.
The text was updated successfully, but these errors were encountered: