在此范围内未声明C boost -_______SERT_FAIL
C++ Boost - __assert_fail was not declared in this scope
当前我正在开发将在Raspberry Pi 3上使用的库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 引起了这个合理性问题。
我只是遇到了看起来像同一问题。
奇怪的是,我没有在伸展或克星中看到这个问题,而只有在牛里。您是否使用不是来自Raspbian档案的ImageMagick版本?
无论如何,在我的情况下,Magick 。H最终包括essert.h在名称空间内,当发生这种情况时,它会破坏任何其他试图使用assert.h
的其他代码。解决方法是重新订购您的包含和/或添加一个明确的assert.h,以便在magick 之前包含assert.h。h
相关文章:
- Problems with std::cin.fail()
- 了解 cin.fail() 和 cin.clear语言 - Vector 追加程序
- cin.fail() not returning true
- cin.fail 在输入数字和字母时不起作用
- 我如何检查CIN.FAIL(),但仍使用Ctrl D到达文档的结尾
- OpenCV UIImageToMat linker fail in xcode
- CIN.FAIL无法按预期工作
- Qt WebEngine on fail
- 在C++流中,eof(),fail(),bad()和good()有什么区别
- ICLRRuntimeHost::UnloadAppDomain fail
- 如何使用CIN.FAIL()杀死程序
- What value should `std::stringstream::fail()` return after r
- 检测在ofstream写入过程中的空间不足,stream.fail()无法正常工作
- sgx_ecc256_create_key_pair fail
- 有没有办法将cin.fail和cin.clear翻译成C编程语言
- 如何在cin.fail()中求解循环
- 我是否以不良方式使用ifstream :: fail()方法
- C++ cin.fail() while loop
- 函数中的ifstream var.fail()
- 为什么 cin.fail() 在输入数字后跟字符时不返回 false?