Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. ERROR : terminate called after throwing an instance of 'cppException*'
Forum Updated to NodeBB v4.3 + New Features

ERROR : terminate called after throwing an instance of 'cppException*'

Scheduled Pinned Locked Moved Unsolved C++ Gurus
9 Posts 2 Posters 2.5k 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.
  • S Offline
    S Offline
    Shruthi
    wrote on 2 May 2021, 17:20 last edited by
    #1

    I created the subproject inside the main project. But some API's not working in the subproject. But its working in the main project. And it gives the error:terminate called after throwing an instance of 'cppException*'

    4error1.png

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 May 2021, 17:44 last edited by
      #2

      Hi
      So some code throws an exception.
      You have to dig into the code and see if you can find out why.
      Could be something missing it had in main project or the order of initialization.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Shruthi
        wrote on 2 May 2021, 17:51 last edited by
        #3

        Yes in the debug mode I am able to get where the error is. But the error is while calling the API itself. How to resolve this issue.
        Thank you for fast reply.

        M 1 Reply Last reply 2 May 2021, 17:56
        0
        • S Shruthi
          2 May 2021, 17:51

          Yes in the debug mode I am able to get where the error is. But the error is while calling the API itself. How to resolve this issue.
          Thank you for fast reply.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 2 May 2021, 17:56 last edited by
          #4

          Hi
          But if exact same code worked before, the API must be missing some setup or similar
          as else it should work as it used to.
          Before when worked in main app.
          Did you have the code in main.cpp ?
          It could be when converting to a sub project so of the life scopes of any objects in volved was changed.
          Like when you take code from main.cpp and
          put in a function.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Shruthi
            wrote on 2 May 2021, 18:24 last edited by
            #5

            In the main project the the API calling was in other cpp file.
            But in the subproject I am calling the API inside the main function.
            Will this affect the behaviour?

            M 1 Reply Last reply 2 May 2021, 18:32
            0
            • S Shruthi
              2 May 2021, 18:24

              In the main project the the API calling was in other cpp file.
              But in the subproject I am calling the API inside the main function.
              Will this affect the behaviour?

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 2 May 2021, 18:32 last edited by
              #6

              @Shruthi
              Well it should not as normally its the other way around. moving code from main.cpp to
              a function might change how it works.
              But is that the only change ?
              Move some code from a cpp file to main.cpp ?

              Normally an API dont care if called from main or some other place.

              When you say subproject, do you mean it produces its own exe and the main project also now produce
              an exe and before there was only one exe or anything like that ?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Shruthi
                wrote on 3 May 2021, 00:36 last edited by
                #7

                @mrjj
                Yes Exactly. Before it was only one exe. Now we have two exe. One for main and other for subproject.

                Please let me know what is going wrong in this.

                M 1 Reply Last reply 3 May 2021, 10:06
                0
                • S Shruthi
                  3 May 2021, 00:36

                  @mrjj
                  Yes Exactly. Before it was only one exe. Now we have two exe. One for main and other for subproject.

                  Please let me know what is going wrong in this.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 3 May 2021, 10:06 last edited by
                  #8

                  @Shruthi
                  Hi
                  I think then for the sub-app, something is not linked to it and
                  hence the api will fail.

                  Check the .pro file for the main project what files is linked

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Shruthi
                    wrote on 3 May 2021, 10:37 last edited by Shruthi 5 Mar 2021, 10:40
                    #9

                    In the main project I am using API and in subproject I am using terminal to print the result. In the subproject I removed all the GUI related files. And running through terminal It says this error.

                    And for the main project I have used the 3rd party dynamically linked .so files.

                    I have just copied the main.pro file to the subproject.pro. But still it's not running.
                    Do I want to link this in the pro file.
                    If so, please let me know.
                    Thanks in advance.

                    I think it's simple. But I am not able to figure it out.
                    @mrjj

                    1 Reply Last reply
                    0

                    4/9

                    2 May 2021, 17:56

                    • Login

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