库内发生哪行异常
Which line exception occured inside a library
本文关键字:异常 更新时间:2023-10-16
我使用armadillo
库。 在某处我得到这个异常:
error: Mat::init(): size is fixed and hence cannot be changed
terminate called after throwing an instance of 'std::logic_error'
what(): Mat::init(): size is fixed and hence cannot be changed
Aborted (core dumped)
我知道为什么。但我不知道在哪里。
有没有办法获得导致此问题的行? valgrind
或任何其他工具能够做到这一点吗?
更新:
编译代码:
g++ -g -Wall -Wfatal-errors -Wextra -std=c++11
main.cpp -lboost_filesystem -lboost_system
你能在出现错误的地方发布一小段代码吗?我有类似的错误,但不记得是什么原因造成的,但尝试将命令的结果存储在其他变量中并检查它。并输入"cout"以查找导致错误的语句。
相关文章:
- 处理多个异常集合的C++方法
- 我在c++代码中生成了一个运行时#3异常
- 孤立代码块在结构中引发异常
- C++中的赋值发生,尽管右侧出现异常
- 从构造函数抛出异常时如何克服内存泄漏
- 异常属于C++中的线程还是进程
- 当类定义不可见时捕获异常
- 引发异常:读取访问冲突**dynamicArray**为0x1118235.发生
- 为什么异常不退出程序?
- 为什么我应该在异常处理中使用std::cerr而不是std::cout
- 如何修复链表类实现的未处理异常0xDDDDDDDD
- 关于:C++中异常对象的范围:为什么我没有得到副本?
- 是什么导致了Unity 3D中的"错误线程异常"?
- 如何将strftime中的格式错误作为异常捕获
- 创建具有 new in 函数和"this is nullptr"异常的对象
- 尝试使用智能指针时引发异常
- 函数如何通知用户它基于函数原型抛出异常?
- 是否值得降低我的代码的可读性,以便在出现内存不足错误时提供异常安全性?
- 当我使用 C++ 中的 C# dll 来使用 Selenium 时,存在异常处理问题
- Pytorch torch.cholesky忽略异常