Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
Qt Creator 4.6.0
-
None
-
Windows 10
Qt Creator 4.6.0
Qt 5.10.1 (MSVC 2015, 32 bit)
MSVC C++ Compiler 15.0 (x86_amd64)
Description
While writing a method for the derived QObject class, I accidentally named it setCustomEvent(). After building the project there were linker issues and I realized my mistake.
After refactoring and changing the method name to logCustomEvent() I tried to rebuild once more. Now neither the mainwindow class nor the derived class use that method name, but linker throws issue for both of them (mainwindow never even had a method with that name):
mainwindow.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::setCustomEvent(class QEvent *)" (?setCustomEvent@QObject@@MEAAXPEAVQEvent@@@Z)
gazecomunicator.obj:-1: error: }}{{LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::setCustomEvent(class QEvent *)" (?setCustomEvent@QObject@@MEAAXPEAVQEvent@@@Z)
I tried following:
- Clean project + Run Qmake + Rebuild project
- Manually deleting build folder and repeat clean+qmake+build
- Removing Q_OBJECT macro and comment out all signal/slot uses, then add it back
- Adding the setCustomEvent() method to both mainwindow and derived class. (Linking still fails for mainwindow but the issue disappears for derived class)
- Rolling back the code to the point where I know it worked and make clean+qmake+build
- Deleting the code and making a fresh clone from git
Nothing seems to work and the linking issue always appears
UPDATE: The same issue exists after porting to MSVC2017 and trying to build
UPDATE 2: Bug disappeared after reinstallation of Qt (identical options; Qt Creator 4.6.0, Qt 5.10.1, MSVC 2015 MSVC c++ 15.0)
Attachments
Issue Links
- relates to
-
QTCREATORBUG-8561 Using the refactor feature modifies stock Qt headers without being open
- Closed
- resulted in
-
QTBUG-72766 Install headers as read-only to prevent accidently modifications
- Reported