没有找到Boost /lexical_cast.hpp

boost/lexical_cast.hpp not found

本文关键字:lexical cast hpp Boost      更新时间:2023-10-16

在我不幸删除的另一个项目中,我能够使用Boost。我在项目配置中添加了库,然后声明

#include <boost/lexical_cast.hpp>

一切正常

现在在我的新项目中,我得到错误

boost/lexical_cast.hpp not found

我已遵照http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html#link-from-within-the-visual-studio-ide

上的指示

我已将boost_1_58_0libs的路径添加到链接器->通用->附加库。

但是,现在编译器会抛出上面的错误。

有谁知道我可能做错了什么吗?我没有改变任何关于Boost。

你读错章节了

那一章是关于将Boost对象文件链接到您的项目,但是Boost。LexicalCast是一个仅限头文件的库,与此相关的是介绍性IDE设置指令(在同一页面上)。

我找到了解决方案。Boost网站上的说明是错误的。

在这里找到的是正确的:https://elektron9.wordpress.com/2014/09/10/configuring-c-boost-libraries-for-visual-studio/

我必须做以下额外的工作使它工作:

C/c++所有的选项其他包含库在这里添加Boost的路径(而不是官方文档所说的Boost/lib或Boost/libs)