Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Inconistant QMake results with MSVC and Subdirs Project?
Forum Updated to NodeBB v4.3 + New Features

[Solved] Inconistant QMake results with MSVC and Subdirs Project?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jh224
    wrote on last edited by
    #1

    I recently made a switch from Qt 4.8 minGW to Qt 5.1 MSVC 64 bit. My project is a subdirs project with 4 projects (common, dialogA, dialogB and mainWindow). When I ran the target project (mainWindow) with Qt 4.8 minGW, I never had a problem and the mainWindow always launched when I hit run. However, once I made the switch to Qt 5.1 MSVC 64, the results have been very intermittent. Sometimes when hit run, it dies silently, other times dialogA launches, and once in a blue moon my mainWindow launches. I've tried several things but nothing has provided me with a consistent result. I've double checked and tripled checked to make sure my run target is correct. I've cleaned, ran qmake and then rebuild for the whole project and also one project at a time, but I always get inconsistent results. Any suggestions?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jh224
      wrote on last edited by
      #2

      After doing a little more troubleshooting, I was able to isolate my problems to QMAKE. Once I had good makefiles, I was able clean and rebuild many times quite reliably. On a project that would not run, I swapped the bad makefiles with good makefile and I could rebuild and run just fine. I did a comparison (with the diff tool) of the good makefiles and bad makefiles and here is what I found.

      • Subdirs project - the same with the exception of the time stamp
      • sub projects - very different. obj files listed in very different order and the bad makefiles were larger...one was larger by over 400 lines.

      Any Suggestions?

      The following section seems to be random when running qmake and seems to be key....when I copy and paste this section from the good makefile to the bad makefile, I can rebuild and run project.

      @
      From the Makefile

      .SUFFIXES: .c .cpp .cc .cxx

      {..\common\customwidgets}.cc{}.obj::
      $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
      $<
      <<
      {..\common\customwidgets}.cxx{}.obj::
      $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
      $<
      <<
      {..\common\customwidgets}.c{}.obj::
      $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
      $<
      <<
      {..\common\customwidgets}.cpp{}.obj::
      $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
      $<
      <<

      ...this pattern continues until it completes all the obj files for my project.....but every time I run qmake this section is in a different order.
      @

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jh224
        wrote on last edited by
        #3

        I created a test project from scratch with the same structure and I noticed the makefile did not have the same section which is causing the problem. What controls "Implicit rules"?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jh224
          wrote on last edited by
          #4

          The problem was "QTBUG-13496":https://bugreports.qt-project.org/browse/QTBUG-13496

          The work around is to put the following in the project file (.pro):

          @CONFIG += no_batch@

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved