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. Linking Protobuf Build is successful but states "The program has unexpectedly finished" while running.

Linking Protobuf Build is successful but states "The program has unexpectedly finished" while running.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 391 Views 1 Watching
  • 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.
  • V Offline
    V Offline
    VimHar
    wrote on last edited by VimHar
    #1

    Re: [Solved] Linking in a static library

    I am adding a Protobuf lib to an existing project. Everything builds without any errors or warnings. However, when I try to run the application, it immediately fails out with this error:
    [quote]The program has unexpectedly finished.

    My . pro file

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    CONFIG += c++11

    LIBS += -LC:/64Msys/protobuf-3.21.12/src/.libs/ -lprotobuf
    PRE_TARGETDEPS = C:/64Msys/protobuf-3.21.12/src/.libs/libprotobuf.a

    INCLUDEPATH += C:/64Msys/protobuf-3.21.12/src/

    SOURCES +=
    main.cpp
    mainwindow.cpp
    m.pb.cc

    HEADERS +=
    mainwindow.h
    m.pb.h

    FORMS +=
    mainwindow.ui

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

    Build succeeds, but crashed while running. But when I run the executable from outside(not in qt) its working. Kindly helo

    630d165b-e05c-4f0d-bb94-f24ec5735030-image.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Run a debug version of the program in your debugger and see where it crashes (a backtrace).

      V 1 Reply Last reply
      1
      • C ChrisW67

        Run a debug version of the program in your debugger and see where it crashes (a backtrace).

        V Offline
        V Offline
        VimHar
        wrote on last edited by VimHar
        #3

        @ChrisW67 Hi friend, I got this
        e2b8ae38-ecd0-4b65-9710-56c94507ef33-image.png

        I have enabled QML in debugger settings as states here. still the same
        https://forum.qt.io/topic/10528/could-not-connect-to-the-in-process-qml-debugger
        68427f46-f70d-44a1-b6d7-c65ec696c414-image.png

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Is your program using QML? The file we see in your first post seem to imply a generic widgets application.

          You need to build a debug version of the project and then use the "Start debugging of startup project" button.
          976fbdfd-8024-4d0d-8a0f-3f7ab81d46d8-image.png
          When it crashes the backtrace portion of the debugger windows will give a clue where your code is coming unstuck.
          f864fa66-caa5-4f0c-99d2-65cb42ec49b0-image.png

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved