Boost :: asio链接;找不到标识符; C ++

时间:2013-08-16 21:56:36

标签: c++ boost linker boost-asio

我搜索了我的问题的错误行,几乎没有任何点击,我不会说俄语。我还找到了this,但它似乎对我没有帮助。

这是我的代码

#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;

不确定从哪里开始。

0 个答案:

没有答案