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. How to find Bug in Qt!!
QtWS25 Last Chance

How to find Bug in Qt!!

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 6 Posters 1.3k Views
  • 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
    Saeed_Nowroozi
    wrote on last edited by
    #1

    Hi All,
    I have compiled my project and have some errors, but I can not find where the code has a problem. I know the errors are from the stl library(vetor, pair, tuple), but I've used a lot of this library in my project and Qt does not show any problems.. Have a solution?
    0_1547796935402_qqq.PNG

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

      Hi,

      What version of Qt are you using ?
      What compiler is it ?
      What's in the offending part of your code ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Saeed_Nowroozi
        wrote on last edited by
        #3

        Qt Creator 4.3.1
        Qt 5.9.0 MinGW 32 bit
        some classes I use stl container. for example
        0_1547798725170_Class.PNG
        0_1547798743235_class2.PNG

        jsulmJ 1 Reply Last reply
        0
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #4

          https://en.cppreference.com/w/cpp/memory/allocator_traits

          According to those docs it is a template for classes not "int". Am I reading that right?

          C++ is a perfectly valid school of magic.

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

            Hi
            it seems to come from smart_algorithm.cpp line 47

            1 Reply Last reply
            1
            • S Saeed_Nowroozi

              Qt Creator 4.3.1
              Qt 5.9.0 MinGW 32 bit
              some classes I use stl container. for example
              0_1547798725170_Class.PNG
              0_1547798743235_class2.PNG

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Saeed_Nowroozi Please show your smart_algorithm.cpp from where the error is actually coming.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • S Offline
                S Offline
                Saeed_Nowroozi
                wrote on last edited by Saeed_Nowroozi
                #7

                thanks, this is class smart_alg. classes are not finished.
                0_1547835172932_Class4.PNG 0_1547835212554_class5.PNG
                and these are .cpp code.
                0_1547835294041_class7.PNG 0_1547835308011_class8.PNG 0_1547835325153_class9.PNG

                jsulmJ 1 Reply Last reply
                0
                • S Saeed_Nowroozi

                  thanks, this is class smart_alg. classes are not finished.
                  0_1547835172932_Class4.PNG 0_1547835212554_class5.PNG
                  and these are .cpp code.
                  0_1547835294041_class7.PNG 0_1547835308011_class8.PNG 0_1547835325153_class9.PNG

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #8

                  @Saeed_Nowroozi __smart_alg() has a return value but there is no return.
                  Also:

                  std::vector<int,int>
                  

                  ?!

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  4
                  • J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #9

                    __counting also expects a return value.


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

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

                      Hi
                      so you write
                      so std::vector<int,int> which makes it think you give it a custom allocator but
                      then it gets unhappy as an int is not expected type at all or related to std::allocator.

                      In any case, it does actually tell where the error comes from, so it's important to read it carefully to spot the place
                      that starts the chain of ugly errors.
                      alt text

                      1 Reply Last reply
                      4
                      • S Offline
                        S Offline
                        Saeed_Nowroozi
                        wrote on last edited by
                        #11

                        Think's all
                        problem is solved.

                        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