Modify

Opened 5 years ago

Closed 5 years ago

#8287 closed Bugs (invalid)

_WIN32_WINDOWS breaks connect() on XP

Reported by: toby_toby_toby@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.53.0 Severity: Showstopper
Keywords: win32 macro asio Cc:

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 Anthony K <toby_toby_toby@…>

#define _WIN32_WINNT 0x0501

also works fine, only _WIN32_WINDOWS throws... Sorry if I use it wrong way =)

comment:2 Changed 5 years ago by Anthony K <toby_toby_toby@…>

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: http://msdn.microsoft.com/en-us/library/windows/desktop/ms742213%28v=vs.85%29.aspx

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 Anthony K <toby_toby_toby@…>

FIREWALL I R E W A L L

comment:4 Changed 5 years ago by chris_kohlhoff

Resolution: invalid
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chris_kohlhoff.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.