Reputation: 8511
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?
Upvotes: 3
Views: 3266
Reputation: 8511
From 'qt_newbie89' (http://qt-project.org/forums/viewthread/23200):
I have “accidentally” solved the problem. I rightclicked on the project folder in the Project windows and choose qmake. After that, choose Run and all the errors disappeared. I don’t know why that works by the way.
From 'ChrisW67' (http://qt-project.org/forums/viewthread/23253/):
The Makefile file did not “become corrupted”: it was exactly as you left it, full of commands and paths suitable for the previous Qt 4 installation. When Qt Creator ran nmake to build the project nmake did not automatically re-run qmake to generate the Makefile because the (untouched) Makefile was newer than the pro file that generated it. This is normal and correct make behaviour, but it resulted in a mismatch between your Qt5 in stall and expected Qt4 install.
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.
Upvotes: 3
Reputation: 532
This happened to me as well and I did following.
Upvotes: 1
Reputation: 1523
I suspected that you would not be the only one who had this problem. Have you looked at: this yet? It talks about a PERL script in qt/base/bin called: fixqt4headers.pl. This is designed to fix the headers. I noticed another link which might help if that doesn't fix you up, try this, it looks to be fairly well thought out. And, no I haven't tried it. I haven't actually upgraded to Qt 5 yet. CHEERS!
Upvotes: 1