Project compilation errors with boost asio

I created a separate project for connecting my server component to clients using TCP / IP with boost :: asio. At first I created and tested this project separately at first and tested these classes, everything worked fine.

Adding this to my server component now no longer compiles, and I get the following compiler errors in code that is not even my code!

   c:\Program Files\boost\boost_1_44\boost\asio\detail\impl\win_iocp_io_service.ipp(442): error C2039: 'CreateWaitableTimer' : is not a member of 'operator``global namespace'''


    c:\Program Files\boost\boost_1_44\boost\asio\detail\impl\win_iocp_io_service.ipp(442): error C3861: 'CreateWaitableTimer': identifier not found, even with argument-dependent lookup

I have no idea why I am getting these errors, I checked all included paths and all included files in the project.

Does anyone have any suggestions as to what might cause these errors?

The header file "tcp_server.h" is included in my project and is the one that causes errors. This is the class defined inside this file (written by me)

#include "stdafx.h"

#include "tcp_connection.h" //boost shared_ptr etc included inside this file already
#include <ResolverQueueHandler.h> //Handles threaded queues for requests from client

class tcp_server
{
public:
    tcp_server::tcp_server(boost::asio::io_service& io_service, int port,boost::shared_ptr<ResolverQueueHandler> queue_handler);


private:

    void start_accept();
    void handle_accept(tcp_connection::pointer new_connection, const boost::system::error_code& error);

    boost::asio::io_service _io_service;
    boost::asio::ip::tcp::acceptor acceptor_;
    boost::shared_ptr<ResolverQueueHandler> _queue_handler;
    int _port;
};
+3
2

Windows SDK API, , #define s. Windows, , , , Windows 98.

::CreateWaitableTimer Windows 2000. #define - , ++:

#define _WIN32_WINNT 0x0400

:

CreateWaitableTimer: http://msdn.microsoft.com/en-us/library/ms682492(v=vs.85).aspx

Windows: http://msdn.microsoft.com/en-us/library/aa383745(v=vs.85).aspx

+3

Per , #define _WIN32_WINNT , .

+1

Source: https://habr.com/ru/post/1790400/


All Articles