增强 MSVC 11 中的"destructor is not virtual"错误
Boost "destructor is not virtual" error in MSVC 11
我正试图使用MSVC 11.0编译一个带有boost 1.57.0的程序,但我得到了以下错误:
z:ddevboost_1_57_0boostexceptionexception.hpp(171) : error C4265: 'boost::exception_detail::error_info_container' but destructor is not virtual instances of this class may not be destructed correctly
我能做些什么吗?
这些帖子似乎没有提供解决方案
- http://boost.2283326.n4.nabble.com/boost-exception-detail-error-info-base-does-not-have-virtual-destructor-td3384903.html
- http://boost.2283326.n4.nabble.com/Re-exception-warning-about-non-virtual-destructor-resolution-td4554753.html
我以前应该考虑过这个问题。该错误是通过/W4
升级为错误的警告。我设法通过在include周围包装一个警告禁用来修复它。
#pragma warning(push)
#pragma warning(disable : 4265)
#include <boost/...>
#pragma warning(pop)
相关文章:
- OpenMP卸载说'fatal error: could not find accel/nvptx-none/mkoffload'
- C++核心准则 C35 对于接口类"A base class destructor should be either public and virtual, or protected and nonv
- 使用JsonCpp将数据返回到带有pybind11的python会在python调用中产生Symbol not foun
- OpenCV Android C++ imwrite not found
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 使用单词"not"作为C ++类的名称会导致VS2019错误
- 错误"Could not find Boost"(缺少:上下文标头)
- 如何修复"error: ‘_1’ was not declared in this scope"?
- 套接字连接"Operation not permitted"错误,甚至使用升压/平发器根.cpp
- 当我从下面的代码中删除关键字 virtual 时,它可以正常工作,否则会出现错误。在这里"virtual"字的意义是什么?
- Is !NaN not a NaN?
- 为什么我会" void value not ignored as it ought to be"?
- 解决"ld: library not found for -ltensorflow_framework.2.3.0"
- 加载与引用 .NET DLL 位于同一文件夹中的引用的 .NET DLL 时"Not found"异常
- Directx 11 - CompileFromFile() is not compiling
- 方法错误"not all control paths return a value"和方法不返回值
- Centos7 g++ "to_string is not in a member of std"
- 将系数存储在头文件的数组中("does not name a type"错误)
- 类 C++ 错误:"Virtual is not allowed"
- 增强 MSVC 11 中的"destructor is not virtual"错误