error: no matching function for call to 'std::exception:exception(const char[16])'
来源:互联网 发布:农村淘宝 广告 编辑:程序博客网 时间:2024/05/22 14:40
LZ在扒有些源代码的时候,会遇到如下的一个问题,就是源代码的作者是在windows下运行的,但是LZ的编译环境是ubuntu,所以在使用windows下编译通过的代码的时候,仍然会碰到各种各样的问题。
高博说过如果你Linux足够牛的时候,在考虑在Windows下进行一些开发编译,所以LZ还是乖乖的选择了Linux。
具体报错如下所示:
error: no matching function for call to 'std::exception:exception(const char[16])'
只要把代码修改成以下格式就行了
std::logic_error ex("XXXXX");throw std::exception(ex);
然后你可能以为问题就解决了,然而下面的错误小伙伴们可能还会遇到:
error:expected class-name before '{' token {std::logic_error is not a menber of 'std'
报这个错误的原因是:对应的头文件没有加(继承时不能忘记加基类的头文件)
#include <stdexcept>
感觉现在念书,重点应该不是自己掌握了多少的知识,而是如果遇到了一个问题怎么样解决这个问题,注重的是解决问题的能力吧O(∩_∩)O哈哈~
感谢百度和谷歌,还有很多大神的分享^_^,不然靠自己,速度不知道会慢多少倍!
阅读全文
0 0
- error: no matching function for call to 'std::exception:exception(const char[16])'
- error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&)
- error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&)
- error: no matching function for call to 'std::basic_ifstream<char>::open(std::string&)
- error: no matching function for call to
- 【求助】 no matching function for call to `strcpy(std::string&, char*&)'
- no matching function for call to 'strstr(stdstring&, const char [4])'
- C++ - 标准异常报错(call to 'std::exception::exception(const char [n])')
- error: no matching function for call to 'MainWindow::connect(*&, ...)
- no matching function for call to ‘transform
- no matching function for call to ‘transform
- no matching function for call to 'sort(...),
- G++编译错误 no matching function for call to '_tag_data_value::StringAddLen(std::string, int, int)
- C++中错误no matching function for call to transform
- [c++]no matching function for call to ‘sort(…)......
- 【C++错误处理】no matching function for call to transform
- 【C++错误处理】no matching function for call to transform
- No matching function call to 'pthread_create'
- 初学SpringMVC 小总结(有些术语说的不准确以后会加强,有些只是我个人理解,发现有问题可以告诉我)
- C#静态类
- laravel5.5 路由分割成不同文件
- iOS开发之UI篇(8)—— UITextField
- Ubuntu环境下配置PHP7+Apache+MySQL图文教程
- error: no matching function for call to 'std::exception:exception(const char[16])'
- 使用swiper里的animate动画时出现的错误
- linux awk命令详解
- 自定义语言的实现——解释器模式(六)
- VIM:正常模式、插入模式、命令模式、可视模式
- rxjava学习笔记
- js捆绑时转换对(0=女 1=男) 类型的替换写法
- Oracle新建Schema
- 1363数字游戏