C++ Boost - 在此范围内未声明 __assert_fail

标签 c++ boost raspberry-pi g++ boost-filesystem

目前我正在开发将在 Raspberry Pi 3 上使用的库。为了循环遍历目录中的所有文件,我决定使用 boost::filesystem 模块。我准备了这段代码:

#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>

boost::filesystem::path targetDir(some_path);
boost::filesystem::directory_iterator it(targetDir), eod;

BOOST_FOREACH(boost::filesystem::path const& p, std::make_pair(it, eod))
{
    if (boost::filesystem::is_regular_file(p))
    {
        // do smth with file
    }
}

Boost 已通过 apt-get install libboost1.62-all-dev 安装。

不幸的是,在 Visual Studio 2017(在远程 RPi 目标上,g++ 4.9.2)中编译时出现了一堆错误:

__assert_fail was not declared in this scope (path_trails.hpp)
...
__assert_fail was not declared in this scope (path.hpp)
...
__assert_fail was not declared in this scope (shared_ptr.hpp)

我做错了什么?

最佳答案

该问题与 boost 无关。我有#include <Magick++.h>上面的行,这会导致这些输出错误。评论此行后,一切运行正常,现在我需要找出 Magick++ 导致此兼容性问题的原因。

关于C++ Boost - 在此范围内未声明 __assert_fail,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43676010/

相关文章:

用于在嵌入式设备上显示网页的 Java 组件

visual-studio-code - 使用 SSH 到 Raspbian 的 Visual Studio Code 远程开发

c++ - 如何将 vector<string> 和 push_back() 格式化为其他 vector ?

c++ - C++ 所需的具有 C 链接的回调函数

c++ - C++ boost lambda 和 == 运算符的问题

c++ - 如何在Visual Studio 2017中安装和使用boost 1.66.0

node.js - 在 Raspberry pi 4 上运行 mongodb 服务器

c++ - QCustomplot - 隐藏/显示选定的图形

c++ - std::vector::erase 异常安全

c++ - 从 equal_range 查询过滤和修改 boost::multi_index 中的元素