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.


  • Qt Champions 2016

    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.


  • Qt Champions 2016

    @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 -= gui

    TARGET = 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?


  • Qt Champions 2016

    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?



  • @mrjj Sorry for the later reply, The problem exists.
    I use GCC to compile, is there a specific requirement for boost to compile?


  • Qt Champions 2016

    @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?


  • Qt Champions 2016

    @dennile
    Hello,

    It can build, but it always close without a signal.

    You haven't connected anything (from your example) so what signal are you expecting?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.