命名空间提升没有成员
namespace boost has no member
我下载了最新版本的Boost库1_60_0,并尝试使用它,但很快就遇到了麻烦。
boost::unordered_map<int, int> map;
这段代码表示"名称空间boost没有成员unordered_map"。我检查了文件,它就在那里。基本上,我尝试从boost命名空间访问的所有内容都发生了同样的情况。
标题包括以下内容:
#include <D:/IP/boost_1_60_0/boost/graph/adjacency_list.hpp>
#include <D:/IP/boost_1_60_0/boost/graph/graph_traits.hpp>
#include <D:/IP/boost_1_60_0/boost/graph/connected_components.hpp>
#include <D:/IP/boost_1_60_0/boost/unordered_map.hpp>
#include <D:/IP/boost_1_60_0/boost/graph/floyd_warshall_shortest.hpp>
#include <D:/IP/boost_1_60_0/boost/numeric/ublas/matrix.hpp>
#include <D:/IP/boost_1_60_0/boost/numeric/ublas/io.hpp>
我想我应该包括更多的内容,但不知道是什么。有什么建议吗?
unordered_map.hpp
以这种方式包含其他boost头文件:
#include <boost/config.hpp>
这意味着boost
文件夹必须设置为一个额外的包含目录才能工作。
我假设您是在MSVC上编译的,如果是,请右键单击您的项目:properties->C/C++->General,并将文件夹D:/IP/boost_1_60_0/
添加为Additional Include Directory。
文档也为您回答了这个问题。
相关文章:
- 命名空间 std 没有成员any_of
- 为什么 Clang 在命名空间'std'中没有名为 'copy' 的成员给出错误
- 初始化命名空间中的变量是否类似于将它们初始化为类成员?
- 在 c++ 中使用类的命名空间定义类的成员
- Catalina C++:使用<cmath>标头产生错误:全局命名空间中没有名为 'signbit' 的成员
- 命名空间 Win 没有成员"simpleControl"是什么意思
- Visual Studio 2017:命名空间"System"没有成员"Windows"
- 如何从嵌套在命名空间中的类调用成员函数?
- 成员的结构与命名空间的潜在范围
- 类成员函数在其命名空间之外定义
- Typedef 不是命名空间的成员
- 命名空间 pcl 在点云库中没有名为 PointCloud 的成员
- 将typeID转换为静态成员访问(C )的命名空间
- 无法解析命名空间成员"线程"
- 命名空间:不能在没有对象的情况下调用成员函数
- "uintmax_t":不是"全局命名空间"的成员
- OpenCV CUDA 函数缺失 - 命名空间"cv:cuda"没有成员"resize"
- 错误:"成员"在此上下文中是私有的 - 命名空间
- 从另一个命名空间访问标准命名空间数据成员
- 使用命名空间进行函数成员定义