我使用Windows 7中的Qt Creator。当我使用32位VC 2010编译器编译我的项目时,出现错误:
错误:C1083:无法打开包括文件:“boost / asio.hpp”:没有那个文件或目录
.pro文件:
LIBS += -L"D:/MDT/boost_1_71_0/libs" -
llibboost_date_time-vc141-mt-x32-1_71 \
-
L"D:/MDT/boost_1_71_0/libs" -
llibboost_regex-vc141-mt-x32-1_71 \
main.cpp
#include <boost/asio.hpp>
#include "boost/asio/associated_allocator.hpp"
而不是这样#include <boost/asio/associated_allocator.hpp>
?如果不是这种情况,请检查文件是否存在。例如,对我来说它在'C:\Users\Username\Documents\Boost\boost\asio\associated_allocator.hpp'。在这种情况下,INCLUDEPATH 应该是C:\Users\Username\Documents\Boost
,并且 include 指令应该看起来像#include <boost/asio/associated_allocator.hpp>
。 - SingerOfTheFall