Unfortunately due to the nature of this bug I did not find an isolated case to provide, but I can describe steps to reproduce:
I was working on the DockWindow example for QMainWIndow, and I decided I wanted to integrate DarkStyle from a repo, but manually had to copy and add files to the project.
I added a few new files and folders from DarkStyle in something like this order:
The files DarkStyle.cpp and DarkStyle.h
The darkstyle/ folder (copied from inside an archive download)
The images/ folder
Then I copied framelesswindow/ folder and its contents to qt-mainapp/ but had not yet added it to the project or resources, however I did add darkstyle/ and images/ at this point.
I "Add Existing Items..." and added the DarkStyle.cpp and Darkstyle.h files
Then, I built and it threw LNK4042 on DarkStyle.h
Caught off guard, I added some #pragma once and the issue went away, it built.
Everything built and ran correctly, but the title bar was not changed because I only used the DarkStyle object. I wanted to add the framelesswindow object.
I then added framelesswindow/ after further consideration, but for a reason the framelesswindow.ui was not included (its a form)
I then added the images/ folder and the darkstyle/ folder to the .qrc from Add Existing Items.. context menu.
When I went to manually add
to the .pro file for the project, I noticed the HEADERS and SOURCES lists were really, really long, but I added the FORMS line and proceeded to build.
I then built and it came back with something like 24 issues LNK4042
After examining the .pro file, I saw that all of my original files (before adding DarkStyle files at all) in the HEADERS and SOURCES section were duplicated somewhat randomly twice.
So if before it was:
it now read:
This was repeated for SOURCES as well.