C++中错误总结
1. “error: xxx in namespace ‘std’ does not name a template type”
或是 “error: xxx does not name a type”
1.1 错误原因:未导入相应的头文件
1.2 解决方法:添加对应的头文件
- string:#include <string>
- list:#include <list>
- vector:#include <vector>
- function:#include <functional>
2. Error opening ‘libxxx.so’: libxxx.so: cannot open shared object file: No such file or directory
1.1 错误原因:没有添加共享库所在目录到系统路径中
1.2 解决方法:
export LD_LIBRARY_PATH="[共享库所在目录]"