与BUG的邂逅
文章平均质量分 66
ForeverHaibara
这个作者很懒,什么都没留下…
展开
-
Anaconda UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb4 in position 0: invalid start byte
Anaconda Navigator 启动卡在 Loading Application,报错:utf8 code can't decode...原创 2022-07-18 11:53:06 · 4002 阅读 · 4 评论 -
pyinstaller 打包 matplotlib:Failed to execute script ... WindowsPath ... matplotlibrc
本文记述 pyinstaller 打包 matplotlib 遇到的问题与解决方案,包括:Failed to execute scriptTypeError: expected str, bytes or os.PathLike object, not WindowsPathNo such file or directory matplotlibrcFailed to determine matplotlib's data directory原创 2022-02-15 14:23:18 · 1353 阅读 · 1 评论 -
PyQt 和 Matplotlib 展示 LaTeX
PyQt 和 Matplotlib 渲染 LaTeX原创 2022-02-15 13:06:55 · 1601 阅读 · 0 评论 -
超详细VSCode 配置 C语言环境 (或 C++) Windows 64位
VSCode 运行 C 或 C++原创 2022-01-12 00:27:04 · 2591 阅读 · 1 评论 -
C++ 判断类型的结构体 __are_same
文章目录__are_same__are_same<T1,T2>C++模板template的存在,为重载函数提供了很多方便。但有些时候我们要对不同的类型作不同的处理(比如整型与浮点型、实数与复数)。比如我要实现如下函数:f(x)={x+1,x是int型,x,x非int型.f(x)=\left\{ \begin{array}{ll} x+1 & ,x是int型, \\ x & ,x非int型.原创 2021-11-16 16:16:48 · 1658 阅读 · 0 评论 -
template argument deduction/substitution failed: couldn‘t deduce template parameter 解决方案
文章目录报错代码报错原因解决方案报错代码希望实现一个找到区间最大值的泛型函数,参数是左右迭代器,返回最大值。#include<iostream>#include<vector>using namespace std;template<class T>T findmax(typename vector<T>::iterator left,typename vector<T>::iterator right){ T ret = *原创 2021-07-26 22:56:41 · 8235 阅读 · 0 评论 -
cwchar:179:11: error: ‘::wcscat‘ has not been declared
文章目录报错代码报错原因解决方案报错代码写一个类,为了方便把测试用的main函数写在同一个文件中。#ifndef _STRING_H#define _STRING_H#include<vector>#include<iostream>using namespace std;class myStr{ vector<char> data;public: myStr(const char* s=NULL){ for (;s&原创 2021-05-13 21:55:33 · 515 阅读 · 0 评论 -
python包模块内部调用 No module named
文章目录报错代码报错原因解决方案报错代码在以下目录结构中写一个名为 cal 的包,内有 calPrime.py 和 isPrime.py 两个模块其中:isPrime.py:(作用是判断一个正整数是否为质数)def judgePrime(n): if n < 5: return [False,False,True,True,False,True][n] for i in range(2,int(n**0.5)+1): if n%i == 0 : return原创 2021-04-11 11:28:01 · 650 阅读 · 0 评论 -
qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in ““解决方案
文章目录报错原因解决方案报错在 import PyQt5 并使用时,出现以下错误:qt.qpa.plugin: Could not find the Qt platform plugin “windows” in “”This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.原因Qt所原创 2021-04-03 17:07:00 · 13448 阅读 · 3 评论 -
cannot bind non-const lvalue reference of type ‘xxx&‘ to an rvalue of type ‘xxx‘
文章目录报错代码报错原因解决方案报错代码#include<iostream>using namespace std;class Complex{private: double r,i;public: Complex(double _r,double _i=0):r(_r),i(_i){} double re() {return r;} double im() {return i;} void print(){ cout <原创 2021-03-25 22:04:07 · 3425 阅读 · 0 评论 -
passing ‘const xxx‘ as ‘this‘ argument discards qualifiers [-fpermissive]
文章目录报错代码报错原因解决方案报错代码#include<iostream>using namespace std;class Complex{private: double r,i;public: Complex(double _r,double _i=0):r(_r),i(_i){} double re() {return r;} double im() {return i;} void print(){ cout <原创 2021-03-25 21:58:39 · 634 阅读 · 0 评论 -
std::bad_alloc,运算符重载与临时变量
文章目录报错代码报错原因解决方案报错代码写一个复数类 Complex ,支持加号重载:#include<iostream>using namespace std;class Complex{private: double r,i;public: Complex(double _r,double _i=0):r(_r),i(_i){} double re(){return r;} double im(){return i;} void prin原创 2021-03-25 21:30:06 · 1369 阅读 · 0 评论 -
no match for ‘operator-‘ (operand types are ‘std::_List_iterator<int>‘std::__lg(__last - __first) *2
文章目录报错代码报错原因解决方案报错代码#include<iostream>#include<list>#include<random>#include<algorithm>using namespace std;int main(){ list<int> a; for (int i=0;i<10;++i) a.push_back(rand()); for (auto num: a) cout <&原创 2021-03-23 20:09:20 · 3584 阅读 · 0 评论 -
undefined reference to xxx 多文件编译链接 解决方案
文章目录报错代码报错原因解决方案报错代码同一个文件夹中三份文件:main.cpp, add.cpp, add.hmain.cpp 内容如下:#include<iostream>#include"add.h"using namespace std;int main(){ cout << add(3,4) << endl; system("pause"); return 0;}add.cpp 内容如下:#include"add.h原创 2021-03-23 19:50:02 · 1829 阅读 · 1 评论 -
reference to non-static member function must be called 解决方案
目录报错代码报错原因解决方案报错代码#include<iostream>#include<vector>#include<algorithm>using namespace std;class Sol{public: bool cmp(int a,int b){ return a < b; } void mysort(vector<int>& a){ sort(a.begin(),a.end(),原创 2021-03-04 17:03:25 · 740 阅读 · 1 评论