错误的原因是我使用到了 QT Widgets 模块中的东西,但是makefile的链接的参数中没有 widgets。其实官网上提到了这个:

http://doc.qt.io/qt-5/qtwidgets-index.html

 

解决的方法是手动修改你的 .pro 文件,在里面添加下面这句:

QT += widgets

 

如果出现类似的 undefined reference 这种错误应该也是在程序的链接阶段没有找到相应的函数或方法,解决方法也应该类似。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-12-25
  • 2021-12-11
相关资源
相似解决方案