本文介绍了将Qt4移植到Qt5:未解析的外部符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qt5是新一代的Qt,它有一些变化。



我有一个项目与Qt4建立良好。我已经下载Qt5-VisualStudio2010包,我试图将我的项目从Qt4到Qt5。出现问题。



所有include路径已修复。但是,编译器现在报告数百个未解析的外部符号(几乎所有的函数调用,听起来像编译器不能找到任何.lib文件)。我甚至试图添加在Qt SDK文件夹中找到的所有.lib文件,但没有用。最基本的类和方法:QApplication :: exec(...)也报告为未解析的符号。



项目文件已更改为适合Qt5包装:

  myproject.pro档案:
QT + = widgets
pre>

任何人都有类似的经验,这个新版本的Qt?

解决方案

从qt_newbie89():

从ChrisW67():

我的说法:
是啊,真的解决了链接问题!问题实际上是,当项目是用Qt4创建时,'make'文件也与项目一起创建。当我删除Qt4,安装Qt5,并导入旧的项目通过Qt5(与新的Qt Creator),可能'make'文件已损坏。


Qt5 is the new generation of Qt and it has some changes.

I have a project building well with Qt4. I've downloaded Qt5-VisualStudio2010 package and I'm trying to port my project from Qt4 to Qt5. Problems arise.

All 'include' paths have been fixed well. However, the compiler now reports hundreds of 'unresolved external symbols' (almost all function calls, sounds like the compiler can't find any .lib file). I even tried to add all .lib files found in the Qt SDK folder, but useless. The most basic class and method: QApplication::exec(...) also reported as 'unresolved symbol'.

The project file has been changed to fit Qt5 packaging:

myproject.pro file:
QT += widgets

Anyone have got similar experience with this new release of Qt?

解决方案

From 'qt_newbie89' (http://qt-project.org/forums/viewthread/23200):

From 'ChrisW67' (http://qt-project.org/forums/viewthread/23253/):

My saying:Yeah, that really solves the linking problem! The problem was actually that, when the project was created with Qt4, the 'make' file was also created along with the project nicely. When I removed Qt4, installed Qt5 and imported the old project by Qt5 (with new Qt Creator), possibly the 'make' file became corrupted.

这篇关于将Qt4移植到Qt5:未解析的外部符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-25 18:28