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. [solved] building a "standalone" program

[solved] building a "standalone" program

Scheduled Pinned Locked Moved Qt Creator and other tools
20 Posts 8 Posters 7.9k 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
    mzimmers
    wrote on 19 Apr 2012, 00:28 last edited by
    #1

    Hi -

    I'm currently using Creator to build a couple of programs that don't use any of the Qt libraries or classes ("Empty Qt Project") in the "New" dialog). Once I build the program, I rename the QtSDK directory (so it can't find any of the libraries), but when I attempt to launch from Creator, I get an error that the path to qmake.exe isn't found. Why is Creator trying to find qmake.exe when I've already built the program? This program does launch successfully from a CLI.

    And another question: I have a second program, that (I think) is built with identical build/run/environment settings, but this program won't even launch from the CLI (even when the QtSDK directory is properly named). I've copied the same .dll files to its directory as I added to the directory of the program that works. But, the first program runs fine (from the CLI) and the second one just immediately returns the CLI prompt.

    Any tips on how I can chase down what's going on here? I've run Dependency Walker, but it's not giving me any information that I find meaningful.

    Thanks for any help; this is getting aggravating.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      veeraps
      wrote on 19 Apr 2012, 01:24 last edited by
      #2

      Hi,

      Try emptying 'Qt Versions' under Qt Creator -> Tools -> Qt4. It should have a path or link to qmake.exe. You may want to try deleting this entry.

      If you built the program, you must be having the binary (either in debug or release folder), which you can execute from explorer. Am curious to know why do you want to launch it from Creator?

      Have you put any qdebug statements or any message box kind of thing to see whether something comes up during error. Or simply, what does second program do?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mzimmers
        wrote on 19 Apr 2012, 02:00 last edited by
        #3

        Hi, veeraps. I can't find anything called "Qt4" under "Tools."

        As for why I want to launch from Creator:

        I love the IDE and wish to continue using it for development

        While right now I'm not using the Qt libraries, this will soon change

        I'm trying to encourage customers to adopt Qt, and I need to be their "answer man" on things that come up with it

        But...the issue isn't launching from Creator...I can do that. My problem is the program that won't launch from the CLI. I need to fix this ASAP.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          veeraps
          wrote on 19 Apr 2012, 02:34 last edited by
          #4

          Hi,

          Pardon me it is under Tools -> Options -> Qt4. I use Qt Creator 2.2.1.

          What does your second application do? Is it a GUI application or non GUI application? I am sure if some .dll file is missing, you might get run-time errors, are you not getting it?

          On a side note, I would suggest there is another IDE - Eclipse (think you might have heard it as well) "Eclipse-Indigo":http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers-includes-incubating-components/indigor, which you can use it if you are doing C++ development. Infact I pretty much like it.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mzimmers
            wrote on 19 Apr 2012, 02:51 last edited by
            #5

            I still don't have anything called "Qt4" in Options. Under Creator -> Tools -> Options -> Build & Run I can get to "Qt Versions," but the only version in there is an Auto-detected one that I can't delete. (Nor do I think I'd want to.)

            The second application is purely CLI at the moment. When I try to invoke it, the CLI prompt just returns immediately. I'm pretty confident that the program isn't even loading.

            And yes, I've heard of Eclipse. A fine IDE, but I'm somewhat invested in Creator and would prefer to remain with it. Whatever this problem is, it's almost certainly nothing that will drive me away from Creator.

            Thanks...

            1 Reply Last reply
            0
            • V Offline
              V Offline
              veeraps
              wrote on 19 Apr 2012, 03:49 last edited by
              #6

              Yes! my mistake again - it cannot be deleted - but it says 'Qt in PATH', so I tried deleting the Qt bin path in my PATH variable.

              After deleting it, I found that 'Qt in PATH' reads as <not found>. Then I noticed at the top mean the header, it says that 'qmake location'. I presume Qt Creator needs a 'qmake' location.

              My last option to try would be - try to remove Qt bin path in your PATH variable and try executing Qt Creator - am not sure it will work though.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mzimmers
                wrote on 19 Apr 2012, 13:41 last edited by
                #7

                By renaming the top-level Qt directory, I think I'm doing essentially the same thing as removing any Qt directories from PATH. This isn't a show-stopper (the other problem I reported is much more pressing); I was just curious why Qt would need qmake to launch an already built program.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mlong
                  wrote on 19 Apr 2012, 15:36 last edited by
                  #8

                  bq. I was just curious why Qt would need qmake to launch an already built program.

                  As I understand it, when you try to run a program in Creator, it still attempts to rebuild if necessary. This is why you don't have to hit the "Build" button and then the "Run" button when developing apps in Creator. Since qmake is an intrinsic part of of the build process, I'd guess that's why it is complaining.

                  Software Engineer
                  My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mzimmers
                    wrote on 19 Apr 2012, 15:40 last edited by
                    #9

                    Hi, mlong -

                    Yeah, that sort of occurred to me, too. Perhaps qmake needs to run itself in order to decide that it isn't needed.

                    Anyway, that's a minor inconvenience...the other issue I posted about is far more urgent.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mzimmers
                      wrote on 22 Apr 2012, 21:50 last edited by
                      #10

                      Bump...anyone with ideas on how to remedy the issue highlighted above?

                      Thanks.

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mzimmers
                        wrote on 1 May 2012, 18:43 last edited by
                        #11

                        Another data point: I hex-edited my executable, searched for ".dll" and came up with these:

                        1. libgcc_s_dw2-1.dll
                        2. mingwm10.dll
                        3. msvcrt.dll
                        4. KERNEL32.DLL
                        5. __register_frame_info.libcj_s.dll

                        I have copies of 1 and two in my executable folder; I was told I don't need 3 and 4.

                        5 is a mystery. I can't even find it on my system. And googling doesn't turn up much about it. Can anyone tell me something about this file, and why my program seems to be referencing it?

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          goetz
                          wrote on 2 May 2012, 19:49 last edited by
                          #12

                          I can't - and I would straightly ignore it :)

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mzimmers
                            wrote on 2 May 2012, 21:26 last edited by
                            #13

                            Well, I don't mind ignoring it, but I'm still unable to launch this program from the command line, so I need to figure something out pretty quick. If the problem isn't a missing .dll, I'm not sure where to turn to find the problem.

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              goetz
                              wrote on 2 May 2012, 21:29 last edited by
                              #14

                              Sorry, that's hard to tell from remote. And to be honest, I'm out of ideas what could go wrong here.

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mzimmers
                                wrote on 2 May 2012, 21:39 last edited by
                                #15

                                Yeah, I understand. Someone told me it might be a side of effect of using the 32-bit version of MinGW on a 64-bit system. I tried adding my 64-bit version of the compiler to my tool chain, but I'm not able to get it ahead of the one it finds automatically. I've put a path to the 64-bit version ahead of the path to the one in QtSDK in my PATH variable, and even renamed the QtSDK directory to block access, but it still comes up with \QtSDK\mingw\bin first in the list. Any ideas on this?

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  mzimmers
                                  wrote on 3 May 2012, 13:41 last edited by
                                  #16

                                  Ahhhhhhh!

                                  The problem was in the .pro file. Evidently, failure to explicitly exclude Qt from the configuration resulted in a few references to Qt functions somewhere in the binary. The winning .pro code is:

                                  @CONFIG += CONSOLE
                                  CONFIG -= qt@

                                  Thanks to everyone for the assistance.

                                  1 Reply Last reply
                                  0
                                  • B Offline
                                    B Offline
                                    bootfinder
                                    wrote on 15 May 2014, 08:51 last edited by
                                    #17

                                    I have a similar problem...

                                    I am running Ubuntu 12.04 with QT Creator 2.4.1

                                    • most applications run both from the IDE and by double clicking the .exe file, but some applications ONLY run within the IDE, and not when I double click the (same) executable file.

                                    Why???

                                    1 Reply Last reply
                                    0
                                    • JKSHJ Offline
                                      JKSHJ Offline
                                      JKSH
                                      Moderators
                                      wrote on 15 May 2014, 11:18 last edited by
                                      #18

                                      [quote author="bootfinder" date="1400143896"]I have a similar problem...

                                      I am running Ubuntu 12.04 with QT Creator 2.4.1

                                      • most applications run both from the IDE and by double clicking the .exe file, but some applications ONLY run within the IDE, and not when I double click the (same) executable file.

                                      Why???[/quote]Hi bootfinder,

                                      Please read the "official Linux deployment documentation":http://qt-project.org/doc/qt-5/linux-deployment.html, as well as this excellent "blog post about deployment":http://www.tripleboot.org/?p=138

                                      Anyway, your problem sounds different from the original problem in this thread. If you'd like more help, please start a new thread.

                                      P.S. Qt Creator 2.4.1 is extremely old. I recommend upgrading to "Qt Creator 3.1":http://qt-project.org/downloads

                                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        MunchyYDL
                                        wrote on 30 Jun 2014, 22:16 last edited by
                                        #19

                                        I have had a similar problem, sometimes my apps worked differently, depending on if I launched it from within Qt Creator, or from the Finder or terminal on OS X.

                                        My problems occurred because the current directory was different depending on from where i launched the application, so that might be something that you guys can check.

                                        1 Reply Last reply
                                        0
                                        • jensen82J Offline
                                          jensen82J Offline
                                          jensen82
                                          wrote on 1 Jul 2014, 11:04 last edited by
                                          #20

                                          What do you mean with "my apps worked diffrently"? And yes, the current directory is not the directory where your exe-file exists.

                                          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