我正在使用boost更新从C到C ++的程序。我无法获得#include< boost \whatever.hpp>并使用boost作为命名空间来工作。
我进入了附加包含目录和其他#using目录并添加了boost的路径,但它仍然无法识别该目录。 / p>
有什么建议吗?
谢谢。
解决方案
亲爱的朋友,
感谢您的发帖。
我可以问你身边的Boost版本吗?
Boost 1.63 不支持完全支持VS2017 ,但你可以欺骗它找到VC ++ 2017编译器:
;
Boost 1.64 , 应支持VS2017:
运行" x86 Native Tools命令从开始菜单提示VS 2017"或"x 2017 Native Tools Command Prompt for VS 2017",而不是在命令提示符内运行 b2 :
32位: b2 toolset = msvc-14.1 --build-dir = .x86 --stagedir = stage_x86
64 -bit: b2 toolset = msvc-14.1 address-model = 64 --build-dir = .x64 --stagedir = stage_x64
添加 link = shared 到构建共享库
希望它有所帮助。
祝你好运,
Fletcher
Hi,
I'm updating a program from C to C++ that is using boost. I am having trouble getting the #include <boost\whatever.hpp> and using boost as a namespace to work.
I went into the Additional Include Directories and Additional #using Directories and added the path for boost, but it still doesn't recognize the directory.
Any suggestions?
Thanks.
解决方案Dear friend,
Thanks for your posting.
May I ask the version of Boost in your side?
For Boost 1.63 which doesn't fully support VS2017, but you can trick it to find VC++2017 compiler:
For Boost 1.64,it should support VS2017:
Run "x86 Native Tools Command Prompt for VS 2017" or "x64 Native Tools Command Prompt for VS 2017" from Start Menu, than inside command prompt runb2:
32-bit:b2 toolset=msvc-14.1 --build-dir=.x86 --stagedir=stage_x86
64-bit:b2 toolset=msvc-14.1 address-model=64 --build-dir=.x64 --stagedir=stage_x64
Addlink=sharedto build shared libraries
Hope it helps.
Best regards,
Fletcher
更多推荐
将Boost添加到VS2017项目中
发布评论