Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    2
    7
    2263
    Loading More Posts
    • 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
      nando76 last edited by

      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 Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by

        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 Reply Quote 0
        • N
          nando76 last edited by

          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 Reply Quote 0
          • Chris Kawa
            Chris Kawa Moderators last edited by

            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 Reply Quote 0
            • N
              nando76 last edited by

              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 Reply Quote 0
              • Chris Kawa
                Chris Kawa Moderators last edited by

                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 Reply Quote 0
                • N
                  nando76 last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post