QT will just close the interface without any signals
-
my code is like these:
#include <QCoreApplication>
#include "boost/tuple/tuple.hpp"
#include "gnuplot-iostream.h"
#include <cmath>
#include <vector>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
std::vector<boost::tuple<double,double,double,double>> gpa_A;return a.exec();
}
It can build, but it always close without a signal. When I open it again, nothing will be saved if I do not save it before. i am using QT 3.5.1. I want to know whether it is related with the code or something else? I just add a boost lib. I do not know whether it is the problem. -
hi and welcome
you main seems pretty normal except no mainwindow.if u remove
std::vector<boost...
it still just closes?It could be the boost lib if also using a DLL
and there is compiler mismatch so when it loads the dll
it dies.Did you try to single step into main and see if that provides more info?
-
@mrjj I remove std::vector<boost....but the problem still.
i also try to comment all the thing related with boost, but it closes while I just comment the code...
I am a new guy, I really do not know what to do. I will try to write a simple code. I think the problem should be related with boost. -
@dennile said:
but it closes while I just comment the code...
wait. while you in QCreator. the editor. and change code
it closes the editor ?Just for test.
Have you made a default project via File->New->Qt WIdget Application and run it ?
Just to be sure if all is ok.How did u add BOOST?
-
@mrjj said:
Qt WIdget Application a
I use the QT application->QT console application.
I build all the boost library, and then add the boost lib into the pro file.
The following is the pro:
QT += core
QT -= guiTARGET = testforgnuplot
CONFIG += console
CONFIG -= app_bundle
INCLUDEPATH += /home/yunxiaoshan/Downloads/boost_1_60_0/
TEMPLATE = app
INCLUDEPATH += /home/yunxiaoshan/Downloads/gnuplot-iostream-master
LIBS += -L/home/yunxiaoshan/Downloads/boost_1_60_0/stage/lib -lboost_system
SOURCES += main.cpp
I am a new guy in C++, I install all of the boost lib. And then include the header file.
Is there anything wrong? -
Hi
It seems fine.
I wonder what compiler you use and the download of boost is for that compiler?For Qt there is normally Visual Studio X version and then the default compiler
mingw.Which of these are u using and does it match the boost lib you have downloaded?
-
@dennile
Hmm if you used gcc to compile, all should be fine in that regards
After that, you open the .pro file, right click it and selected "Add Library"
then set for linux etc. and pointed to the boost lib?I wondering if somehow program get other version of boost from system.
if you start in debug mode and single step, can u see which line it dies at?