Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT Creator for plain C++ under windows, executable complains about missing DLL

QT Creator for plain C++ under windows, executable complains about missing DLL

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 4 Posters 77 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.
  • M Offline
    M Offline
    monegator
    wrote last edited by monegator
    #1

    Hello,
    sometimes i need to make smaller console programs. They are simple enough that i don't need Qt for them, but i still want to use Qt Creator for development.

    Development and debugging is fine, but i can't run the built exe file outside of creator. (build in release mode, of course)
    Double clicking on the exe i'm presented with an "impossible to find entry point" dialog.

    The project is being getting compiled with the Qt 6.10 MinGW Kit

    Initially i thought the problem was me using MinGW instead of MSVC. Same issue with the LLVM and MSVC kits.
    Instead, if I build the project with plain MinGW (copy CMakeList.txt and source files in another folder, use VSCodium's CMake plugin), i get a working executable.

    I'd like to understand what i'm doing wrong:

    • Is using a Qt kit to build a non-qt application the problem?
    • Can/Should i add plain MinGW as a "kit"?
    • Is there a way to do what i want with Qt Creator? Because while i can use VSCodium or another IDE for debugging, i really prefer Qt Creator's interface.

    Thanks

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

      Hi @monegator

      I'm currently not sure what exactly your problem is, but:

      Is there a way to do what i want with Qt Creator?

      For sure, I have done this a dozen times.

      I'd suggest you create a "Hello World" plain C / C++ program from Creators Wizard for Test. To run standalone, you'll need the MinGW runtime DLLs (I can look that up tomorrow when I'm back on a Windows machine).

      Some more hints:

      Is using a Qt kit to build a non-qt application the problem?

      No, but your make script should not reference Qt. I mostly use Qmake, there you have to specify CONFIG -= QT. The Creator wizard should set that up correctly.

      Should i add plain MinGW as a "kit"?

      I have never needed that.

      Regards

      Qt has to stay free or it will die.

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

        @monegator So I've checked on a Windows machine that has MinGW 8.1 32 bit. On that machine I created a Hello World Program with File > New Project > Non-Qt Project > Plain C Application, build that and could run it outside Creator without any DLL deployment.

        But in case MinGW DLLs are needed, you will find them under c:\Qt\Tools\mingw810_32\bin (replace mingw810_32 with your version).

        If it still does not work, then please provide the exact error message for further investigation.

        Regards

        Qt has to stay free or it will die.

        J.HilkJ 1 Reply Last reply
        1
        • aha_1980A aha_1980

          @monegator So I've checked on a Windows machine that has MinGW 8.1 32 bit. On that machine I created a Hello World Program with File > New Project > Non-Qt Project > Plain C Application, build that and could run it outside Creator without any DLL deployment.

          But in case MinGW DLLs are needed, you will find them under c:\Qt\Tools\mingw810_32\bin (replace mingw810_32 with your version).

          If it still does not work, then please provide the exact error message for further investigation.

          Regards

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote last edited by
          #4

          @aha_1980 I refuse to believe :P ! It's not a clean windows/vm right? It has to have modified path variable or something


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

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

            @J.Hilk I didn't believe it too, so I cleaned the PATH and successfully tested again :)

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • M Offline
              M Offline
              monegator
              wrote last edited by monegator
              #6

              Hi guys, thanks for answering :)
              I transitioned to CMake between Qt5 and Qt6, so i didn't even try the QMake approach
              I was unable to find the missing DLLs, thanks to pointing to where they're at, nor what their name was (dependency walker did not help here, because all i got was mangled names)

              One interesting thing, then: VSCodium's CMake build will produce a self contained exe (~600kB instead of ~100) so what i probably want is a static build?

              JonBJ 1 Reply Last reply
              0
              • M monegator

                Hi guys, thanks for answering :)
                I transitioned to CMake between Qt5 and Qt6, so i didn't even try the QMake approach
                I was unable to find the missing DLLs, thanks to pointing to where they're at, nor what their name was (dependency walker did not help here, because all i got was mangled names)

                One interesting thing, then: VSCodium's CMake build will produce a self contained exe (~600kB instead of ~100) so what i probably want is a static build?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by
                #7

                @monegator
                cmake does nothing but invoke compilers/linkers per the rules it is given. It doesn't affect anything itself. I would start by getting it to show the full compiler/linker lines it is executing (and showing its exported environment variables would also be useful). Then you will know what is actually being done. You can see whether e.g. one is a static link and the other a dynamic one, and (hopefully) why it produces something workable in one case but not another.

                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