Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#5791 closed Bugs (wontfix)

(MinGW) fail to compile asio when c++0x enabled

Reported by: Jamboree <tongari95@…> 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)

comment:1 by MKP, 11 years ago

Use -std=gnu++0x flag instead of -std=c++0x and it should work.

in reply to:  1 comment:2 by Jamboree <tongari95@…>, 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 chris_kohlhoff, 10 years ago

Resolution: wontfix
Status: newclosed

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 christoffer.green@…, 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.

Note: See TracTickets for help on using tickets.