Opened 5 years ago
Closed 5 years ago
#8287 closed Bugs (invalid)
_WIN32_WINDOWS breaks connect() on XP
Description
#define _WIN32_WINDOWS 0x0501 // this macro causes exceptions in main() // without it works fine. by the way, WINVER 0x0501 works fine #include <boost/asio.hpp> int main(int argc, char** argv) { boost::asio::io_service s; boost::asio::deadline_timer dt( s ); // this will throw boost::asio::ip::tcp::acceptor a(s); // or this if you comment timer return 0; }
I have not updated (since 2002) Windows XP SP3, week-old fresh VS2010, boost 1.44 or 1.53 (both tested - same).
Both deadline_timer and acceptor (and maybe something else) throwing here:
namespace boost { namespace asio { namespace detail { socket_select_interrupter::socket_select_interrupter() { ... if (socket_ops::connect(client.get(), (const socket_addr_type*)&addr, addr_len, ec) == socket_error_retval) boost::asio::detail::throw_error(ec, "socket_select_interrupter"); // error core 10022.
Attachments (0)
Change History (4)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
Problems continued with Win Socket connect() function, it doesn't want to work with same error even without boost, clean project (tested in CodeBlocks? and VS 2010 express), both with MinGW and VisualC (it means different SDK) =(
I took example from here:
Tried different versions: 2.0, 2.1, 2.2
Bad windows probably. But strange, how other applications working, for example browser? =))
comment:3 Changed 5 years ago by
FIREWALL I R E W A L L
comment:4 Changed 5 years ago by
BTW, the _WIN32_WINDOWS define is used if you want to target a non-NT version of Windows (e.g. Windows 95, 98 or ME). Don't use it for modern Windows platforms.
also works fine, only _WIN32_WINDOWS throws... Sorry if I use it wrong way =)