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. [solved] App crashes direct after start, when using MSVC2012 (Visual Studio 2013) 32bit and 64bit
QtWS25 Last Chance

[solved] App crashes direct after start, when using MSVC2012 (Visual Studio 2013) 32bit and 64bit

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.5k 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.
  • N Offline
    N Offline
    nando76
    wrote on last edited by
    #1

    Hi,
    i moved from MinGW to MSVC compiler.

    Everything compiles without warning.
    But when starting direct after creating QApplication in main the app crashes with the error (see screenshot):

    @ASSERT failure in QGuiApplication::font(): "no QGuiApplication instance", fike kernel\qguiapplication.cpp, line 2764@

    But my main creates the QApplication or QGuiApplication direct at the beginning.
    I tryied with creating QApplication on the heap and on the stack, both times same crash...

    "See ASSERTION screenshot...":https://www.dropbox.com/s/1mdrhip1z2iq53x/qt-error.png?dl=0

    I link against a static lib (my own) which uses QFont..
    Maybe there is a ordering problem... ?

    Greetings
    Nando

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Do you create anything before the QApplication? Do you have any static or global QObjects? Can you show your main() code?

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nando76
        wrote on last edited by
        #3

        Hi,
        i commented out a lot to find the problem.
        My main :

        @int main(int argc, char **argv)
        {
        QGuiApplication application(argc, argv);

        return application.exec();
        

        @

        Really nothing in there now.. BUT i statically link against a library which internally uses QFont members in some classes (but not used / called in this test).

        [quote author="Chris Kawa" date="1419703374"]Do you create anything before the QApplication? Do you have any static or global QObjects? Can you show your main() code?[/quote]

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          bq. BUT i statically link against a library which internally uses QFont members in some classes.

          Maybe IT creates some statics or globals. If you can't inspect or modify that library consider linking to it dynamically, after QApplication has been created.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nando76
            wrote on last edited by
            #5

            the lib against i link is also from me.

            And the lib has one class which hass some QFont members with getters and setters. No static or globals there. But another class inside the lib is singleton so this class has a static but no qt gui stuff usage.

            [quote author="Chris Kawa" date="1419704089"]bq. BUT i statically link against a library which internally uses QFont members in some classes.

            Maybe IT creates some statics or globals. If you can't inspect or modify that library consider linking to it dynamically, after QApplication has been created.[/quote]

            1 Reply Last reply
            0
            • Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by
              #6

              bq. but no qt gui stuff usage

              Doesn't have to be gui stuff. QObject or a call to some of the Qt static functions is enough to make this not work.

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nando76
                wrote on last edited by
                #7

                I do not why, but when building it with MSVC 2013 OpenGL 32 bit it works.

                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