Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/162.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;Boost-\uuu断言\u失败未在此作用域中声明_C++_Boost_Raspberry Pi_G++_Boost Filesystem - Fatal编程技术网

C++ C++;Boost-\uuu断言\u失败未在此作用域中声明

C++ C++;Boost-\uuu断言\u失败未在此作用域中声明,c++,boost,raspberry-pi,g++,boost-filesystem,C++,Boost,Raspberry Pi,G++,Boost Filesystem,目前,我正在开发的图书馆,将用于覆盆子皮3。为了遍历目录中的所有文件,我决定使用boost::filesystem模块。我编写了以下代码: #include <boost/foreach.hpp> #include <boost/filesystem.hpp> boost::filesystem::path targetDir(some_path); boost::filesystem::directory_iterator it(targetDir), eod; B

目前,我正在开发的图书馆,将用于覆盆子皮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无关。我在上面有
#include
行,这会导致这些输出错误。在评论了这一行之后,一切都正常,现在我需要找到Magick++导致此兼容性问题的原因。

我刚刚遇到了类似的问题

奇怪的是,我并没有在《舒展》或《巴斯特》中看到这个问题,只有在《斗牛士》中看到。您使用的imagemagick版本不是来自Raspbian存档吗

在任何情况下,我的案例中的问题是Magick++.h最终在名称空间中包含assert.h,当这种情况发生时,它会破坏尝试使用assert.h的任何其他代码


解决方法是重新排序include和/或添加assert.h的显式include,以便在Magick++.h

Boost在最新编译器上失败之前包含assert.h,因为发布周期非常缓慢。@TatsuyukiIshi这是什么意思?我将无法在RPi上运行boost?
__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)