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. No printed output from program started by QMAKE_POST_LINK
Forum Updated to NodeBB v4.3 + New Features

No printed output from program started by QMAKE_POST_LINK

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 838 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.
  • A Offline
    A Offline
    alank
    wrote on last edited by
    #1

    On Windows only:

    With Qt 5.9 and below (from a console app) I get qDebug and QTest output displayed in the Compile Output window when building the application and running with using the QMAKE_POST_LINK command. With Qt 5.11 I get no output. In both cases I get output if I explicitly execute the program after it is built.

    From Qt 5.9 I see QTest output:
    \libCommon.a -LC:\Qt\5.9.6\5.9.6\mingw53_32\lib C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Testd.a C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Cored.a
    ./debug/FileStoreTests.exe
    ********* Start testing of TestFileTest *********
    Config: Using QtTest library 5.9.6, Qt 5.9.6 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 5.3.0)
    PASS : TestFileTest::initTestCase()
    PASS : TestFileTest::CreateObjectTest()

    From Qt.11 I see the program execute but no output.
    \FileStore\debug\libFileStore.a C:\Workspace\Projects\build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug\Common\debug\libCommon.a
    -LC:\Qt\5.11.2\5.11.2\mingw53_32\lib C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Testd.a C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Cored.a
    ./debug/FileStoreTests.exe
    mingw32-make[4]: Leaving directory 'C:/Workspace/Projects/build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug/BaseLibs/FileStore/FileStoreTests'

    In both cases I am using the version of QtCreator that comes with Qt 5.11, changing the SDK as needed.

    To test this yourself create a simple console program with a qDebug() statement. add the QMAKE_POST_LINK command to the project file as needed.

    Anyone else have this problem? Or am I overlooking some setting for Qt 5.11?

    ... / A

    K 1 Reply Last reply
    0
    • A alank

      On Windows only:

      With Qt 5.9 and below (from a console app) I get qDebug and QTest output displayed in the Compile Output window when building the application and running with using the QMAKE_POST_LINK command. With Qt 5.11 I get no output. In both cases I get output if I explicitly execute the program after it is built.

      From Qt 5.9 I see QTest output:
      \libCommon.a -LC:\Qt\5.9.6\5.9.6\mingw53_32\lib C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Testd.a C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Cored.a
      ./debug/FileStoreTests.exe
      ********* Start testing of TestFileTest *********
      Config: Using QtTest library 5.9.6, Qt 5.9.6 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 5.3.0)
      PASS : TestFileTest::initTestCase()
      PASS : TestFileTest::CreateObjectTest()

      From Qt.11 I see the program execute but no output.
      \FileStore\debug\libFileStore.a C:\Workspace\Projects\build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug\Common\debug\libCommon.a
      -LC:\Qt\5.11.2\5.11.2\mingw53_32\lib C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Testd.a C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Cored.a
      ./debug/FileStoreTests.exe
      mingw32-make[4]: Leaving directory 'C:/Workspace/Projects/build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug/BaseLibs/FileStore/FileStoreTests'

      In both cases I am using the version of QtCreator that comes with Qt 5.11, changing the SDK as needed.

      To test this yourself create a simple console program with a qDebug() statement. add the QMAKE_POST_LINK command to the project file as needed.

      Anyone else have this problem? Or am I overlooking some setting for Qt 5.11?

      ... / A

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @alank said in No printed output from program started by QMAKE_POST_LINK:

      On Windows only:

      With Qt 5.9 and below (from a console app) I get qDebug and QTest output displayed in the Compile Output window when building the application and running with using the QMAKE_POST_LINK command. With Qt 5.11 I get no output. In both cases I get output if I explicitly execute the program after it is built.
      This output goes to "Application Output" which has number 3. "Compile Output" is number 4 and obtains only the qmake, compile and linking outputs.

      From Qt 5.9 I see QTest output:
      \libCommon.a -LC:\Qt\5.9.6\5.9.6\mingw53_32\lib C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Testd.a C:\Qt\5.9.6\5.9.6\mingw53_32\lib\libQt5Cored.a
      ./debug/FileStoreTests.exe
      ********* Start testing of TestFileTest *********
      Config: Using QtTest library 5.9.6, Qt 5.9.6 (i386-little_endian-ilp32 shared (dynamic) debug build; by GCC 5.3.0)
      PASS : TestFileTest::initTestCase()
      PASS : TestFileTest::CreateObjectTest()

      From Qt.11 I see the program execute but no output.
      \FileStore\debug\libFileStore.a C:\Workspace\Projects\build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug\Common\debug\libCommon.a
      -LC:\Qt\5.11.2\5.11.2\mingw53_32\lib C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Testd.a C:\Qt\5.11.2\5.11.2\mingw53_32\lib\libQt5Cored.a
      ./debug/FileStoreTests.exe
      mingw32-make[4]: Leaving directory 'C:/Workspace/Projects/build-OSPF-Desktop_Qt_5_11_2_MinGW_32bit-Debug/BaseLibs/FileStore/FileStoreTests'

      In both cases I am using the version of QtCreator that comes with Qt 5.11, changing the SDK as needed.

      To test this yourself create a simple console program with a qDebug() statement. add the QMAKE_POST_LINK command to the project file as needed.

      Anyone else have this problem? Or am I overlooking some setting for Qt 5.11?

      ... / A

      AKAIK QMAKE_POST_LINK is only executed directly after linking, when it happened. A failure in linking skips that step. Your description reflects my experience with QMAKE_POST_LINK. The command added with QMAKE_POST_LINK can be found in the "Compilation Output" pane, when it is executed.

      However why are starting the application after its linking process with QMAKE_POST_LINK at all?
      Qt creator distinguishes between building and running an application in somewhat separate blocks. A QMAKE_POST_LINK falls into the building block and is there for additional steps to conclude the building.
      When I like to build and run my application I am simply pressing "Ctrl+r". It checks if the application has to be build and eventually starts the building process. When building was not necessary or the building process was successful it starts the application.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      2
      • A Offline
        A Offline
        alank
        wrote on last edited by
        #3

        There is no error in the linking steps. The exe is built and I can see it running in the TaskManager. As to why I do this - it is so I can automatically run unit tests at build time. I build a library, then test it, then build the next library and test it, etc, etc. It is all part of automation.

        jsulmJ 1 Reply Last reply
        0
        • A alank

          There is no error in the linking steps. The exe is built and I can see it running in the TaskManager. As to why I do this - it is so I can automatically run unit tests at build time. I build a library, then test it, then build the next library and test it, etc, etc. It is all part of automation.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @alank Why do you need the exe of your app to run unit tests? It sounds more like you're doing system tests. Unit tests are usually built as own executables containing only parts needed for the unit tests without whole application.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Looks like this has lead to QTCREATORBUG-21238.

            Qt has to stay free or it will die.

            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