C++ 编译遇到的经常性错误

1、error C2061: 语法错误: 标识符

解决方案:https://blog.csdn.net/qq_33248019/article/details/78104744

2、error LNK2001: 无法解析的外部符号  

 ->链接库出错

(1)error LNK2001: 无法解析的外部符号 "public: virtual void * __cdecl XXX::qt_metacast(char const *)"

  error LNK2001: 无法解析的外部符号 "public: virtual int __cdecl XXX::qt_metacall(enum QMetaObject::Call,int,void * *)"

  错误分析:moc_XXXX.cpp文件没有加入项目方案中,检查路径中是否存在此文件,若没有按照解决方案生成,再加入即可

  解决方案:https://www.cnblogs.com/algs/p/13272511.html

 

3、DSO missing from command line    undefined reference to symbol '_ZN

/usr/bin/ld: CMakeFiles/xxx/xxxx.cpp.o: undefined reference to symbol '_ZN5titan4algo5color12ColorMappingENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_S7_PdiNS_8EnvelopeEPPcPNS_8ProgressE'
xxx/libxxx.so: error adding symbols: DSO missing from command line

解决方法:链接动态库libxxx.so,重新编译即可

  

 

posted @ 2022-11-17 10:26  HaijianYang  阅读(157)  评论(0编辑  收藏  举报