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. Missing qt/mocinclude.tmp file [Qt 5.5.1, Visual Studio 2010]
QtWS25 Last Chance

Missing qt/mocinclude.tmp file [Qt 5.5.1, Visual Studio 2010]

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 2.2k Views
  • 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.
  • P Offline
    P Offline
    Phil_W
    wrote on last edited by Phil_W
    #1

    In the course of our Qt4 to Qt 5.5.1 port, we're having a problem replicating a successful application build from one development machine to another.

    On the 2nd machine, no qt/mocinclude.tmp file is being created (in the same directories where all the generated moc_.cpp and ui_.h files go).

    WHY MIGHT THAT BE?

    This is resulting in the following problem with the MOC compilation of Q_OBJECT class header files:

    • moc: Cannot open options file specified with @
    • list itemQCommandLineParser: argument list cannot be empty, it should contain at least the executable name

    The .vcxproj files contain lines such as the following with a "@./qt/mocinclude.tmp" term:

    <Command Condition="&apos;$(Configuration)|$(Platform)&apos;==&apos;Debug|x64&apos;">
    setlocal&#x000D;&#x000A;if errorlevel 1 goto VCEnd&#x000D;&#x000A;C:\Riverware\tools\
    Qt-551\qtbase\bin\moc.exe -DWIN32 -DWIN64 -DIL_STD -D_WIN32 -DCW_PRESTOPLOT -DCWDEBUG
    -DUSE_NON_CONST -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_PRINTSUPPORT_LIB
    -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB
    -DQT_CORE_LIB -D_MSC_VER=1600 -D_WIN32 -D_WIN64 @./qt/mocinclude.tmp
    AccountMgrDlg.hpp -o qt\moc_AccountMgrDlg.cpp&#x000D;&#x000A;if errorlevel 1 goto
    VCEnd&#x000D;&#x000A;endlocal</Command>
    

    We're using Visual Studio 2010. The first machine (on which Qt 5.5.1 was actually built) is Windows 7. The second machine is Windows 8.1.

    We DO have a lot of "includes" (paths). This is from a relevant .pro file:

    INCLUDEPATH += \
        ../Accounting \
        ../AccountingGUI \
        ../ClientServer \
        ../DbDmi \
        ../EngrObjs \
        ../GUI \
        ../Halibut \
        ../Opt \
        ../Optimize \
        ../OracleConnect  \
        ../Q3GUI \
        ../QtAccounting \
        ../QtDmi \
        ../QtRpl \
        ../QtRun \
        ../QtSCT \
        ../QtUtils \
        ../Rcl \
        ../Remote \
        ../Rpl \
        ../RplExpression \
        ../RwDoc \
        ../RwOracle \
        ../RwQt \
        ../Servers \
        ../Sim \
        ../Units \
        ../Utils \
        ../VCXX \
        C:/RiverWare/tools/RdfToExcel_Qt-551/include \
        C:/RiverWare/tools/Qwt-612_Qt-551/src \
        C:/RiverWare/tools/RepriseLM-12.0 \
        C:/RiverWare/tools/CPLEX-125/cplex/include \
        C:/RiverWare/tools/CPLEX-125/concert/include \
        C:/RiverWare/tools/Stubs/include \
        C:/RiverWare/tools/tcl-8.6.4/generic \
        C:/RiverWare/tools/gdal-1.9.2/include \
        C:/RiverWare/tools/netCDF-4.3.2/include \
        C:/Riverware/tools/Quazip-0.7.1_Qt-551 \
        C:/RiverWare/tools/protobuf-2.6.0/include \
        C:/RiverWare/tools/icu-55.1/include \
        $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
    

    On the original machine, the generated qt/mocinclude.tmp files have this content:

    -IC:/Riverware/tools/Qt-551/qtbase/mkspecs/win32-msvc2010
    -IC:/Riverware/staff/philw/WinQt5Port3/QtAccounting
    -IC:/Riverware/staff/philw/WinQt5Port3/Accounting
    -IC:/Riverware/staff/philw/WinQt5Port3/AccountingGUI
    -IC:/Riverware/staff/philw/WinQt5Port3/ClientServer
    -IC:/Riverware/staff/philw/WinQt5Port3/DbDmi
    -IC:/Riverware/staff/philw/WinQt5Port3/EngrObjs
    -IC:/Riverware/staff/philw/WinQt5Port3/GUI
    -IC:/Riverware/staff/philw/WinQt5Port3/Halibut
    -IC:/Riverware/staff/philw/WinQt5Port3/Opt
    -IC:/Riverware/staff/philw/WinQt5Port3/Optimize
    -IC:/Riverware/staff/philw/WinQt5Port3/OracleConnect
    -IC:/Riverware/staff/philw/WinQt5Port3/Q3GUI
    -IC:/Riverware/staff/philw/WinQt5Port3/QtAccounting
    -IC:/Riverware/staff/philw/WinQt5Port3/QtDmi
    -IC:/Riverware/staff/philw/WinQt5Port3/QtRpl
    -IC:/Riverware/staff/philw/WinQt5Port3/QtRun
    -IC:/Riverware/staff/philw/WinQt5Port3/QtSCT
    -IC:/Riverware/staff/philw/WinQt5Port3/QtUtils
    -IC:/Riverware/staff/philw/WinQt5Port3/Rcl
    -IC:/Riverware/staff/philw/WinQt5Port3/Remote
    -IC:/Riverware/staff/philw/WinQt5Port3/Rpl
    -IC:/Riverware/staff/philw/WinQt5Port3/RplExpression
    -IC:/Riverware/staff/philw/WinQt5Port3/RwDoc
    -IC:/Riverware/staff/philw/WinQt5Port3/RwOracle
    -IC:/Riverware/staff/philw/WinQt5Port3/RwQt
    -IC:/Riverware/staff/philw/WinQt5Port3/Servers
    -IC:/Riverware/staff/philw/WinQt5Port3/Sim
    -IC:/Riverware/staff/philw/WinQt5Port3/Units
    -IC:/Riverware/staff/philw/WinQt5Port3/Utils
    -IC:/Riverware/staff/philw/WinQt5Port3/VCXX
    -IC:/RiverWare/tools/RdfToExcel_Qt-551/include
    -IC:/RiverWare/tools/Qwt-612_Qt-551/src
    -IC:/RiverWare/tools/RepriseLM-12.0
    -IC:/RiverWare/tools/CPLEX-125/cplex/include
    -IC:/RiverWare/tools/CPLEX-125/concert/include
    -IC:/RiverWare/tools/Stubs/include
    -IC:/RiverWare/tools/tcl-8.6.4/generic
    -IC:/RiverWare/tools/gdal-1.9.2/include
    -IC:/RiverWare/tools/netCDF-4.3.2/include
    -IC:/Riverware/tools/Quazip-0.7.1_Qt-551
    -IC:/RiverWare/tools/protobuf-2.6.0/include
    -IC:/RiverWare/tools/icu-55.1/include
    -IC:/Riverware/tools/Qt-551/qtbase/src/3rdparty/zlib
    -IC:/RiverWare/tools/flexlm
    -IC:/RiverWare/tools/Oracle-12c/include
    -IC:/Riverware/tools/Qt-551/qtwebkit/include
    -IC:/Riverware/tools/Qt-551/qtwebkit/include/QtWebKitWidgets
    -IC:/Riverware/tools/Qt-551/qtbase/include
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtWebKitWidgets
    -IC:/Riverware/tools/Qt-551/qtwebkit/include/QtWebKit
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtWebKit
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtPrintSupport
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtWidgets
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtGui
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtNetwork
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtXml
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtConcurrent
    -IC:/Riverware/tools/Qt-551/qtbase/include/QtCore
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you share your .pro file ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Phil_W
        wrote on last edited by Phil_W
        #3

        Files shown below:
        (1) QtAccounting\QtAccountingGenerated.pro
        (2) Makefiles\library.pro ... mostly just includes next item
        (3) Makefiles\riverwarebase.pro

        (1) QtAccounting\QtAccountingGenerated.pro ...

        #
        # $Id: QtAccounting/QtAccountingGenerated.pro 2013/09/01 00:51:57 philw $
        #
        
        include(../Makefiles/library.pro)
        QT -= qt3support
        
        # Specify path for project .pdb (and .idb) file
        QMAKE_CXXFLAGS_DEBUG   += /Fd"./Debug/QtAccountingGenerated.pdb"
        QMAKE_CXXFLAGS_RELEASE += /Fd"./Release/QtAccountingGenerated.pdb"
        
        # This is needed only if there are files in FORMS3
        # CONFIG += uic3
        
        HEADERS = \
            AccountMgrDlg.hpp \
            AccountSelectGroupBox.hpp \
            AccountingSysConfigDlg.hpp \
            AcctCellColorLegend.hpp \
            AcctSubordTreeWidget.hpp \
            AcctSubordinationViewerDlg.hpp \
            AutoPassThroughAcctDlg.hpp \
            DataObjExchBuilderDlg.hpp \
            SupplyNameFormatDlg.hpp \
            ExchBalanceKeyTreeWidget.hpp \
            ExchangeCfgDlg.hpp \
            ExchangeMgrDlg.hpp \
            InitAccountListSlotsDlg.hpp \
            MultiAcctMethAcctListView.hpp  \
            MultiAcctMethSelConfirmDlg.hpp  \
            MultiAcctMethSelector.hpp  \
            ObjAcctSumSaveDlg.hpp \
            ObjAcctSumSel.hpp \
            OpenAccountDlg.hpp \
            RenameAccountsDlg.hpp \
            SupplyEditor.hpp \
            SupplyMgrDlg.hpp
        
        FORMS = \
            AccountingSysConfigWidgets.ui  \
            AccountMgrWidgets.ui  \
            AutoPassThroughAcctWidgets.ui  \
            DataObjExchBuilderWidgets.ui  \
            SupplyNameFormatWidgets.ui  \
            ExchangeCfgWidgets.ui  \
            ExchangeMgrWidgets.ui  \
            InitAccountListSlotsWidgets.ui  \
            RenameAccountsWidgets.ui  \
            SupplyEditorWidgets.ui  \
            SupplyMgrWidgets.ui
        
        FORMS3 = \
        
        # Local Variables: ***
        # mode: makefile ***
        # End: ***
        

        (2) Makefiles\library.pro ... mostly just includes next item ...

        #
        # $Id: library.pro,v 1.2 2008/04/10 20:48:56 philw Exp $
        #
        
        include(riverwarebase.pro)
        
        TEMPLATE = vclib
        
        CONFIG += staticlib
        
        # Local Variables: ***
        # mode: makefile ***
        # End: ***
        

        (3) Makefiles\riverwarebase.pro ...

        #
        # $Id: Makefiles/riverwarebase.pro 2015/10/27 16:32:10 philw $
        #
        
        QT += network
        # QT -= qt3support  # REMOVED
        QT += xml
        QT += webkit
        QT += widgets
        QT += webkitwidgets
        QT += printsupport
        QT += concurrent
        
        CONFIG += qt debug_and_release exceptions rtti stl
        
        # add the following to *Generated.pro with FORMS3 macros:
        #CONFIG += uic3
        
        QMAKE_UIC3 = Qt483-uic3.pl
        #QMAKE_MOC  = moc.pl
        
        DEFINES += IL_STD
        DEFINES -= UNICODE
        DEFINES += _WIN32
        DEFINES += CW_PRESTOPLOT
        CONFIG(debug, debug|release) {DEFINES += CWDEBUG}
        
        # this symbol is for Tcl, so that the arvs in our Tcl commands do
        # not have to be const arguments
        DEFINES += USE_NON_CONST
        
        FLEXLM_DIR = C:/RiverWare/tools/flexlm
        
        !exists($$FLEXLM_DIR) {
          DEFINES += NO_FLEXLM
        }
        
        # Inline function expansion
        QMAKE_CXXFLAGS_DEBUG += /Ob0
        QMAKE_CXXFLAGS_RELEASE += /Ob1
        
        # Buffer Security Check
        QMAKE_CXXFLAGS_DEBUG += /GS
        
        # Optimize Code
        QMAKE_CXXFLAGS_DEBUG += /Od
        QMAKE_CXXFLAGS_RELEASE += /Og
        QMAKE_CXXFLAGS_RELEASE += /Ot
        
        # Eliminate Duplicate Strings
        QMAKE_CXXFLAGS_RELEASE += /GF
        
        # Enable Function-Level Linking
        QMAKE_CXXFLAGS_RELEASE += /Gy
        
        INCLUDEPATH += \
            ../Accounting \
            ../AccountingGUI \
            ../ClientServer \
            ../DbDmi \
            ../EngrObjs \
            ../GUI \
            ../Halibut \
            ../Opt \
            ../Optimize \
            ../OracleConnect  \
            ../Q3GUI \
            ../QtAccounting \
            ../QtDmi \
            ../QtRpl \
            ../QtRun \
            ../QtSCT \
            ../QtUtils \
            ../Rcl \
            ../Remote \
            ../Rpl \
            ../RplExpression \
            ../RwDoc \
            ../RwOracle \
            ../RwQt \
            ../Servers \
            ../Sim \
            ../Units \
            ../Utils \
            ../VCXX \
            C:/RiverWare/tools/RdfToExcel_Qt-551/include \
            C:/RiverWare/tools/Qwt-612_Qt-551/src \
            C:/RiverWare/tools/RepriseLM-12.0 \
            C:/RiverWare/tools/CPLEX-125/cplex/include \
            C:/RiverWare/tools/CPLEX-125/concert/include \
            C:/RiverWare/tools/Stubs/include \
            C:/RiverWare/tools/tcl-8.6.4/generic \
            C:/RiverWare/tools/gdal-1.9.2/include \
            C:/RiverWare/tools/netCDF-4.3.2/include \
            C:/Riverware/tools/Quazip-0.7.1_Qt-551 \
            C:/RiverWare/tools/protobuf-2.6.0/include \
            C:/RiverWare/tools/icu-55.1/include \
            $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
        
        # flexlm isn't available on 64-bit Windows
        exists($$FLEXLM_DIR) {
          INCLUDEPATH += C:/RiverWare/tools/flexlm
          
          INCLUDEPATH += C:/RiverWare/tools/Oracle-12c/include
        }
        
        UI_DIR = ./qt
        MOC_DIR = ./qt
        OBJECTS_DIR = ./$(Configuration)/$(ProjectName)
        
        # Local Variables: ***
        # mode: makefile ***
        # End: ***
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You should also remove the *_DIR variables.

          Qt Creator doing shadow build by default, you shouldn't need them.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • P Offline
            P Offline
            Phil_W
            wrote on last edited by
            #5

            (I hadn't seen SGaist's post before devising this work-around. See prior message. SGaist -- "also?" -- is something missing there? I'm not seeing any prior suggestions. In any case -- THANKS SO MUCH for taking a look at this for us!)

            To solve (or really, work-around) this problem, we modified qtbase\mkspecs\features\moc.prf

            We first tried changing the name of the temporary include file mocinclude.tmp to mocinclude.opt (basically a patch that had been applied to Qt 5.6, I believe). That didn't help.

            We then commented out the generation and use of that include path file, forcing -I arguments to moc.exe to all be put right on the command line invocation of that program (i.e. regardless of how many of those arguments there were). That worked for us.

            # On Windows, put the includes into a .inc file which moc will read, if the project
            # has too many includes. We do this to overcome a command-line limit on Win < XP
            WIN_INCLUDETEMP=
            
            # [Phil, 6-17-2016, skip the mocinclude file altogether]
            # win32:count(MOC_INCLUDEPATH, 40, >) {
            #     WIN_INCLUDETEMP = $$MOC_DIR/mocinclude.opt
            #
            #     WIN_INCLUDETEMP_CONT =
            #     for (inc, MOC_INCLUDEPATH): \
            #         WIN_INCLUDETEMP_CONT += -I$$inc
            #     write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
            # }
            

            You must invoke qmake.exe on all Qt application project files after making this change to qtbase\mkspecs\features\moc.prf.

            Notice that the original comment indicates that this mocinclude provision was introduced to address a command-line size limit on Windows versions before "XP". :-) However, Qt Technical Support mentions to me that it would technically be possible to exceed the larger command line size limit of subsequent Windows versions, so it's not technically true that this mocinclude provision would never be needed.

            We just couldn't get it to work for us. [Qt 5.5.1, Windows 8.1, Visual Studio 2010 Professional SP1]. The mocinclude.tmp (or .opt) file was absent (when we needed it to exist) when we attempted to build our application in Visual Studio. (See prior notes).

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              "Also" because there was already stuff commented out like the qt3support module.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

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