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. QT will just close the interface without any signals

QT will just close the interface without any signals

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.2k Views 2 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.
  • dennileD Offline
    dennileD Offline
    dennile
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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?

      dennileD 1 Reply Last reply
      0
      • mrjjM mrjj

        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?

        dennileD Offline
        dennileD Offline
        dennile
        wrote on last edited by
        #3

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

        mrjjM 1 Reply Last reply
        0
        • dennileD dennile

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

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          dennileD 1 Reply Last reply
          0
          • mrjjM mrjj

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

            dennileD Offline
            dennileD Offline
            dennile
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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?

              dennileD 1 Reply Last reply
              0
              • mrjjM mrjj

                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?

                dennileD Offline
                dennileD Offline
                dennile
                wrote on last edited by
                #7

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

                mrjjM 1 Reply Last reply
                0
                • dennileD dennile

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

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

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

                    Read and abide by the Qt Code of Conduct

                    1 Reply Last reply
                    0

                    • Login

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