#5791 closed Bugs (wontfix)
(MinGW) fail to compile asio when c++0x enabled
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | Cc: |
Description
After including <boost/asio.hpp> I got the error:
boost_1_47_0/boost/asio/detail/impl/win_static_mutex.ipp:51:63: error: 'swprintf' was not declared in this scope
Without -std=c++0x, it compiles fine, I use g++4.5.2/MinGW on XP SP3.
This causal file seems to be shipped with the new signal_set feature.
Change History (4)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Replying to MKP:
Use -std=gnu++0x flag instead of -std=c++0x and it should work.
Indeed. Thanks for the tip.
comment:3 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I have no plans to change any code for this as it appears to be a MinGW bug, and -std=gnu++0x may be used as a workaround.
comment:4 by , 10 years ago
Since this page comes up on google for people that have this problem there is a better way to solve it other then using -std=gnu++0x. Continue using -std=c++11 or -std=c++0x but add -USTRICT_ANSI since the problem is that -std=c++11 defines the strict ansi stuff, and the workaround -std=gnu++0x does not define it. So we solve it by simply undefining it.
Use -std=gnu++0x flag instead of -std=c++0x and it should work.