Porting Qt4 to Qt5: unresolved external symbols

房东的猫 提交于 2019-12-05 21:12:21
jondinham

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.

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!

This happened to me as well and I did following.

  1. Additionally linked Qt5Widgetsd.lib
  2. Changed the project property 'Treat Wchar_t as buil in' to true (at C++ -> Language section).
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!