Congratulations to our 2022 Qt Champions!

[Solved] Switched from Classes to Static Libraries, now programs exits, now SDK debug hangs at "Launch", program says nothing, no errors, why??

  • Hi,

    I have been at this for days. And, for the lack of any output from the linking process, the SDK or at execution time, I don't really know what is going on, what to search for when looking for help & least of all which forum to ask the following (knowingly vague) question:

    What happened when I changed my Classes into Static Libraries?

    Some background:

    1. I was forming a class around the Qt settings library. The purpose was to, in a single method call, specify the group and item (forgot what they are actually called) inside the *.ini file. That worked fine as a Class.

    2. I wanted to try my hand at statically linked libraries. The new settingsclass library compiles. The old application with out the setting class compiles also. The linking process appears to be able to resolve all the references to the new settingsclass library. But when I run it, the program exits with out a word. And when I run it with debugging, the program hangs. The Qt SDK says "Launching" and freezes.

    3. Ok, so, switching gears, I tried a very simple statically linked library example. Completely independent to all my efforts up till now. That worked!

    4. Next I tried to tie my new settingsclass static library into this simple example. That did not work. The simple application behaved just like my big old application did when first I tried to link it to the settingsclass static library!

    ==what's going on?==

    A. All these problems were encountered on a Windows box.

    B. As far as I know, this settingsclass library and application compiled on a Linux box using a MIPS cross compiler and executed on the MIPS target just fine.

    C. I have already spent many hours resolving the problems with the Windows verses the Linux Makefile. I have resolved all the known problems encountered during the creation of the Windows versions of the *.pro and Makefile.

    D. The simple application really does nothing more then to "new" an instance of the settingsclass found in the settingsclass library then call an initialization routine within the library. Yet placing break point near or before these lines does not break the execution. It is as if the execution of the application never started.

    E. The only major difference between the simple static library example and my settingsclass code was that I still had my settingsclass constructor accepting a QObject variable. I removed that, but it did not make any difference.

    Any thoughts or ideas would be appreciated, thanks...

  • Can you compile and run your program without your own settings-class?

  • Ah, well, I havn't tried that as there are plenty of places in my own program (application) which make calls into the library. I can try commenting all those calls out.

    But I was thinking simply using my settingsclass library in an otherwise working application (remember that simple example I was talking about) was proof that the library was at fault. Or, at least, they way I handled adding the library was at fault.


  • As it turns out, the *.pro file had a mistake in it. The *.pro file line that read "DEFINES += staticlib" should have read "CONFIG += staticlib".

    Do any know where I might have seen warnings or errors for this type of problem? I never saw a thing. And shotgunning it took hours of work. Certainly something I never want to do again.


  • You can DEFINE everything, so there is no way to tell whether adding "staticlib" to DEFINES is an error or desired.

Log in to reply