Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.10.0, 5.12.0
-
None
-
-
f6238e2d3bd96597a618978175b558d0bdbb3be6 (qt/qtbase/5.12)
Description
There are two projects, Project1 and Project2. Both projects contain a class with an identical name, Dependency. The version in Project1 includes the version from Project2. Project1 also contains another class, Dependent, which includes Dependency from Project1. Both projects use global includes for their classes, ie "/include/Project1/Dependency" and "/include/Project1/dependency.h"
Under these circumstances running qmake results in a makefile with a compile command for Dependent that contains the global include for Dependency from Project1, but not the actual header file, yet it does contain the header file for Dependency from Project2:
dependent.o: ../../src/dependent.cpp ../../include/Project1/Dependency \dependent.o: ../../src/dependent.cpp ../../include/Project1/Dependency \ ../../../project2/include/Project2/dependency.h \ ../../../project2/src/dependency.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o dependent.o ../../src/dependent.cpp
The error does not occur when one of the Dependency classes is renamed, or if the Dependency from Project1 does not include Dependency from Project2. It also doesn't occur when both projects share one include path, ie when project1.pro has only one path in INCLUDEPATH
The attachment is a minimized example that produces the error when running qmake.
qmake from Qt versions 5.10 and 5.12 was used and both produced the error.