Linking Protobuf Build is successful but states "The program has unexpectedly finished" while running.
-
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.aINCLUDEPATH += C:/64Msys/protobuf-3.21.12/src/
SOURCES +=
main.cpp
mainwindow.cpp
m.pb.ccHEADERS +=
mainwindow.h
m.pb.hFORMS +=
mainwindow.uiqnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetBuild succeeds, but crashed while running. But when I run the executable from outside(not in qt) its working. Kindly helo

-
Run a debug version of the program in your debugger and see where it crashes (a backtrace).
-
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.

When it crashes the backtrace portion of the debugger windows will give a clue where your code is coming unstuck.


