Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Unable to run an application standalone after adding WIN32 in CMakeLists.txt
Forum Updated to NodeBB v4.3 + New Features

Unable to run an application standalone after adding WIN32 in CMakeLists.txt

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 3 Posters 675 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.
  • S Offline
    S Offline
    Shweta07
    wrote on last edited by
    #1

    Hello,

    We are trying to deploy a GUI application on Windows 10. The application runs without any problems when started from Qt IDE.
    After copying all the required .dlls inside the Release folder, we are also able to start the application from the explorer but only
    as a console application. To avoid the console, after some research we came across this link https://cmake.org/cmake/help/v3.0/command/add_executable.html and this https://cmake.org/cmake/help/v3.0/prop_tgt/WIN32_EXECUTABLE.html#prop_tgt:WIN32_EXECUTABLE which states that after using add_executable(TARGET [WIN32] ...)
    we should be able to start the application as a GUI application instead of a console application. However, after making these changes the application does not start at all, there are no error messages being displayed!

    As, a test we created a Qt QWidgets test application and tried running it from the explorer with the WIN32 flag added in CMakeLists.txt and this seems to work fine.

    We also ran the executables through dependency walker which says that the application crashes with:
    First chance exception 0x406D1388 (Thread was named) occurred in "c:\windows\system32\KERNELBASE.DLL" at address 0x00007FFBB2EAA839 by thread 7.
    00:00:01.032: First chance exception 0xC00000FD (Stack Overflow) occurred in "c:\windows\system32\MSVCRT.DLL" at address 0x00007FFBB4C649FA by thread 1.
    00:00:01.032: Second chance exception 0xC00000FD (Stack Overflow) occurred in "c:\windows\system32\MSVCRT.DLL" at address 0x00007FFBB4C649FA by thread 1.

    We also tried using windeployqt.exe to make sure that no necessary dlls are missing, unfortunately with the same results.
    Any help would be greatly appreciated! Developement environment is as follows:

    Development Environment:
    Qt 5.12.2 using CMake 3.14
    Make Program: Ninja
    Compiler mingw 7.3.0 64-bit
    OS: Windows 10/7 64-bit

    jsulmJ 1 Reply Last reply
    1
    • S Shweta07

      Hello,

      We are trying to deploy a GUI application on Windows 10. The application runs without any problems when started from Qt IDE.
      After copying all the required .dlls inside the Release folder, we are also able to start the application from the explorer but only
      as a console application. To avoid the console, after some research we came across this link https://cmake.org/cmake/help/v3.0/command/add_executable.html and this https://cmake.org/cmake/help/v3.0/prop_tgt/WIN32_EXECUTABLE.html#prop_tgt:WIN32_EXECUTABLE which states that after using add_executable(TARGET [WIN32] ...)
      we should be able to start the application as a GUI application instead of a console application. However, after making these changes the application does not start at all, there are no error messages being displayed!

      As, a test we created a Qt QWidgets test application and tried running it from the explorer with the WIN32 flag added in CMakeLists.txt and this seems to work fine.

      We also ran the executables through dependency walker which says that the application crashes with:
      First chance exception 0x406D1388 (Thread was named) occurred in "c:\windows\system32\KERNELBASE.DLL" at address 0x00007FFBB2EAA839 by thread 7.
      00:00:01.032: First chance exception 0xC00000FD (Stack Overflow) occurred in "c:\windows\system32\MSVCRT.DLL" at address 0x00007FFBB4C649FA by thread 1.
      00:00:01.032: Second chance exception 0xC00000FD (Stack Overflow) occurred in "c:\windows\system32\MSVCRT.DLL" at address 0x00007FFBB4C649FA by thread 1.

      We also tried using windeployqt.exe to make sure that no necessary dlls are missing, unfortunately with the same results.
      Any help would be greatly appreciated! Developement environment is as follows:

      Development Environment:
      Qt 5.12.2 using CMake 3.14
      Make Program: Ninja
      Compiler mingw 7.3.0 64-bit
      OS: Windows 10/7 64-bit

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

      @Shweta07 Check this: https://wiki.qt.io/Using_CMake_build_system

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

      1 Reply Last reply
      3
      • S Offline
        S Offline
        Shweta07
        wrote on last edited by
        #3

        @Jsulm Thanks for the reply. However, this still does not seem to work, application does not start and no other messages are being displayed!

        1 Reply Last reply
        1
        • L Offline
          L Offline
          lukasCerveny
          wrote on last edited by lukasCerveny
          #4

          @Shweta07 Hello, have you solved the problem in the end? I am having the same troubles...

          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