qt-labs / vstools

Other
77 stars 24 forks source link

(MsBuild) moc file compilation no longer includes project references #35

Open Ohmslaw79 opened 1 month ago

Ohmslaw79 commented 1 month ago

Describe the bug During the program compile step (not the MOC compiler) I have recently run into an issue where all of my moc_****.cpp files fail to compile due to unresolvable include paths. I have narrowed this down to the fact that when compiling those files they do not have the paths from referenced projects added to the include paths

To Reproduce

  1. Create a VS solution with 2 projects
    • A QT Project that builds a moc file (QTProj)
    • Another CPP project that has a file to include (RefProj)
  2. In the RefProj properties set VC++ Directories / All Header Files are Public = true
  3. Add RefProj as a project reference to the QTProj
  4. Include a header file from the RefProj in some header file that compiles to a moc file in the QTProj
  5. When you build the solution the raw QTProj files will all compile file, but the Moc file that includes the file from RefProj will fail due to not being able to find the include file

Expected behavior The moc files should have access to all of the includes that the project files do during compilation.

Desktop (please complete the following information):

Additional context We just noticed this issue today (10/22), so if there was an update pushed within the last couple of days it was likely that update that did it.

Build Log: QtWidgetsApplication1.log Minimal Reproducible Example: Test Solution.zip

cvwlp commented 1 month ago

Same here, after my Visual Studio updated the Qt Visual Studio Tools to version 3.3.0.13 this morning.

rlabbe commented 1 month ago

Same issue, several developers including myself at my company can no longer build with this release.

jjsh0503 commented 1 month ago

Our company had the same problem. Could not import external library files from moc_***.cpp. image

Ohmslaw79 commented 1 month ago

This is likely an untenable solution for anyone with numerous project references that are now broken. However, my temporary workaround was to add the required folders to the additional include path in the general build settings for the project. It still seems to be picking up those paths fine, and it has gotten my company building again until this is fixed

DamienKochanek commented 1 month ago

We have the same issue. Short term, we reverted to 3.2.0.47, which is still available here.

DavidDeakins commented 3 weeks ago

We have noticed the same issue in our builds.. Hopefully this will get resolved reasonably quickly.

PiotrGizaB3D commented 2 weeks ago

Same issue here. Gigantic headache... Thank you @DamienKochanek for the link - old version works as expected!

kaheimri commented 2 weeks ago

Thank you very much for reporting this issue; it has been recorded in our public bug tracker, where all further updates will be shared: (MsBuild) moc file compilation no longer includes project references (issue #35)

As a temporary solution, you can roll back to the previous working version by following these steps:

kaheimri commented 3 days ago

We have uploaded a new development release to qt-vsaddin-msvc2022-x64-3.3.0-rev.46.vsix that should fix your issue. If you have any additional questions or need further assistance, please feel free to reach out.