2

我用谷歌搜索了我的问题的错误行,几乎没有命中,而且我不会说俄语。我也找到了这个,但它似乎对我没有帮助。

这是我的代码

#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

int main() {

    boost::asio::io_service io;
    boost::asio::deadline_timer t(io,boost::posix_time::seconds(5));
    t.wait();
    std::cout << "Hello World" << std::endl;

    return 0;
}

这些是我的错误信息:

1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
1>  Main.cpp
1>c:\sdk\boost\asio\detail\impl\win_thread.ipp(52): error C2039: 'QueueUserAPC' : is not a member of '`global namespace''
1>c:\sdk\boost\asio\detail\impl\win_thread.ipp(52): error C3861: 'QueueUserAPC': identifier not found
1>c:\sdk\boost\asio\detail\impl\win_object_handle_service.ipp(374): error C3861: 'RegisterWaitForSingleObject': identifier not found
1>c:\sdk\boost\asio\detail\impl\win_object_handle_service.ipp(416): error C3861: 'RegisterWaitForSingleObject': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

任何见解将不胜感激,谢谢!

编辑在标题之前 添加#include <Windows.h>将错误消息更改为

1>c:\program files (x86)\windows kits\8.0\include\um\prsht.h(607): error C2146: syntax error : missing ';' before identifier 'hdr'
1>c:\program files (x86)\windows kits\8.0\include\um\prsht.h(607): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\windows.h(247): warning C4193: #pragma warning(pop) : no matching '#pragma warning(push)'
1>c:\sdk\boost\asio\detail\socket_types.hpp(22): fatal error C1189: #error :  WinSock.h has already been included

prsht.h:跟踪它导致我找到这个:

typedef struct _PSHNOTIFY
{
    NMHDR hdr; //line 607 NMHDR is undefined.  
    LPARAM lParam;
} PSHNOTIFY, *LPPSHNOTIFY;

不确定从这里去哪里。

4

0 回答 0