fatal error C1189: #error : WinSock.h has already been included 查了下抛出这个错误的boost代码,原来是定义了_WINSOCKAPI_,但没有定义_WINSOCK2API_ 那哪里定义了_WINSOCKAPI_呢? 后来在网上查了下,原来是我包含了Windows.h头文件,而Windows.h头文件又包含了WinSock.h这个老东西 知道原因就简单了,试了下,...
I use a boost asio library in my program. When I compile with Visual C++ obtain this error: [...]\boost_1_45_0\boost\asio\detail\socket_types.hpp(22): fatal error C1189: #error : WinSock.h has already been included How can I fix this error? michi7x7-2 Reply|Threaded| Re: "Wi...
http://www.nabble.com/WinSock.h-has-already-been-included-td18329342.html 后记: 后来还给出了另外一种实现方式,但是编译时发现较多错误,因此也在这边记录下来。 #include <iostream> #include <boost/asio.hpp> #include <boost/bind.hpp> #include <boost/date_time/posix_time/posix_time.hpp> class p...
解决方案: boost_1_72_0\boost\interprocess\detail\win32_api.hpp添加#define BOOST_USE_WINDOWS_H, 如下图: 后续 加了前文所述一行后,又遇到 boost_1_72_0\boost\asio\detail\socket_types.hpp这个文件报出的fatal error C1189: #error: WinSock.h has already been included报错。 解决方法 添加#includ...
fatal error C1189: #error : WinSock.h has already been included 查了下抛出这个错误的boost代码,原来是定义了_WINSOCKAPI_,但没有定义_WINSOCK2API_ 那哪里定义了_WINSOCKAPI_呢? 后来在网上查了下,原来是我包含了Windows.h头文件,而Windows.h头文件又包含了WinSock.h这个老东西 ...