Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Undefined reference to qDebug
Qt 6.11 is out! See what's new in the release blog

Undefined reference to qDebug

Scheduled Pinned Locked Moved Unsolved General and Desktop
38 Posts 8 Posters 36.0k Views 4 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.
  • kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by
    #17

    @ayush_mistral
    At a first glance it looks okay, maybe @SGaist will spot something suspicious, I don't see anything out of the ordinary. What do you have here cmUdp.cpp:73 in your source (+- a couple of lines)? In principle the linker shouldn't be complaining about the destructor. Where does your Qt come from, have you built it yourself or you've installed it from the Qt site? Are you sure the compiler/linker used for building Qt matches the one you're using (although it seem you are)?

    Kind regards.

    Read and abide by the Qt Code of Conduct

    ? A 2 Replies Last reply
    0
    • kshegunovK kshegunov

      @ayush_mistral
      At a first glance it looks okay, maybe @SGaist will spot something suspicious, I don't see anything out of the ordinary. What do you have here cmUdp.cpp:73 in your source (+- a couple of lines)? In principle the linker shouldn't be complaining about the destructor. Where does your Qt come from, have you built it yourself or you've installed it from the Qt site? Are you sure the compiler/linker used for building Qt matches the one you're using (although it seem you are)?

      Kind regards.

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #18

      @kshegunov

      Hi,

      I download the QT version for linux from the Qt website only and for compiling and building my application I am using Qt creator IDE.

      Thanks and Regards
      Ayush

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

        Did you also installed Qt from your distribution ?

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

        A ? 2 Replies Last reply
        0
        • kshegunovK kshegunov

          @ayush_mistral
          At a first glance it looks okay, maybe @SGaist will spot something suspicious, I don't see anything out of the ordinary. What do you have here cmUdp.cpp:73 in your source (+- a couple of lines)? In principle the linker shouldn't be complaining about the destructor. Where does your Qt come from, have you built it yourself or you've installed it from the Qt site? Are you sure the compiler/linker used for building Qt matches the one you're using (although it seem you are)?

          Kind regards.

          A Offline
          A Offline
          asanka424
          wrote on last edited by
          #20

          @kshegunov you are linking with wrong libraries. You might have installed Qt from your package manager. So its linking with your program since linker is finding that before the actual libraries. If you are using Qt Creator go to projects tab and chanch path variable. Or uninstall Qt installed using your package manager

          ? 1 Reply Last reply
          0
          • SGaistS SGaist

            Did you also installed Qt from your distribution ?

            A Offline
            A Offline
            asanka424
            wrote on last edited by
            #21

            @SGaist just saw your post. I am thinking the same

            1 Reply Last reply
            0
            • E eureka

              I'm still at beginner's crawling stage ..
              but I do spot a space in your path .. /QT Projects/
              I've learned to purge all spaces in my projects under development .. e.g. /Qt_Projects/
              May not be relevant to your problem but worth remembering.

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #22

              @eureka

              Thanks for observing I will definitely take care of this in future.

              Regards
              Ayush

              1 Reply Last reply
              0
              • SGaistS SGaist

                Did you also installed Qt from your distribution ?

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #23

                @SGaist

                I am not getting clearly. I download my qt set up from qt website and use the same script for installation.

                Thanks and Regards
                Ayush

                1 Reply Last reply
                0
                • A asanka424

                  @kshegunov you are linking with wrong libraries. You might have installed Qt from your package manager. So its linking with your program since linker is finding that before the actual libraries. If you are using Qt Creator go to projects tab and chanch path variable. Or uninstall Qt installed using your package manager

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #24

                  @asanka424

                  Hi,

                  I didn't install QT from package manager but ran the executable from the set up which I obtained/downloaded from the QT website.

                  Secondly I am also using Google test framework for testing my project but that is not causing any problem.
                  I want to know why including cpp unit library and headers in the .pro file is causing the linking error?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    asanka424
                    wrote on last edited by
                    #25

                    Could you check if you have libQt5*.so in any other place than /home/mistral/Qt/5.5/gcc_64/lib

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

                      This thread got really confusing.

                      @asanka424
                      I'm not linking anything, it's in fact Ayush who's having trouble.

                      @ayush_mistral
                      Make sure you're running the qmake that came with the package you installed, and not a system-wide installed one. That's what's @SGaist was implying with his question, however it seems you do indeed. /home/mistral/Qt/5.5/gcc_64/bin/uic this looks exactly as I'd expect. I don't think your problem is related to the cpp unit library as I mentioned before. Besides running qmake again to recreate the project I'm running out of ideas ...

                      Kind regards.

                      Read and abide by the Qt Code of Conduct

                      1 Reply Last reply
                      0
                      • A asanka424

                        Could you check if you have libQt5*.so in any other place than /home/mistral/Qt/5.5/gcc_64/lib

                        ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #27

                        @asanka424

                        Hi,

                        There are some common libQt5*.so files also present in the path /usr/lib/x86_64-linux-gnu

                        Thanks and Regards
                        Ayush

                        kshegunovK 1 Reply Last reply
                        0
                        • ? A Former User

                          @asanka424

                          Hi,

                          There are some common libQt5*.so files also present in the path /usr/lib/x86_64-linux-gnu

                          Thanks and Regards
                          Ayush

                          kshegunovK Offline
                          kshegunovK Offline
                          kshegunov
                          Moderators
                          wrote on last edited by
                          #28

                          @ayush_mistral
                          Okay, then this: "Make sure you're running the qmake that came with the package you installed, and not a system-wide installed one." is quite relevant.
                          Use the qmake that came with the package you installed. You can find it somewhere in the /home/mistral/Qt/.../bin folder. You go to your project, run make clean, then use the correct qmake to create the Makefile anew, and then you make your project again.

                          Kind regards.

                          Read and abide by the Qt Code of Conduct

                          ? 1 Reply Last reply
                          0
                          • kshegunovK kshegunov

                            @ayush_mistral
                            Okay, then this: "Make sure you're running the qmake that came with the package you installed, and not a system-wide installed one." is quite relevant.
                            Use the qmake that came with the package you installed. You can find it somewhere in the /home/mistral/Qt/.../bin folder. You go to your project, run make clean, then use the correct qmake to create the Makefile anew, and then you make your project again.

                            Kind regards.

                            ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by
                            #29

                            @kshegunov

                            Hi I found the qmake executable in the path Qt5.5/gcc_64/bin folder

                            Can you please tell me which tab should I change in qt projects tab to provide the path for the appropriate qmake?

                            kshegunovK 1 Reply Last reply
                            0
                            • ? A Former User

                              @kshegunov

                              Hi I found the qmake executable in the path Qt5.5/gcc_64/bin folder

                              Can you please tell me which tab should I change in qt projects tab to provide the path for the appropriate qmake?

                              kshegunovK Offline
                              kshegunovK Offline
                              kshegunov
                              Moderators
                              wrote on last edited by
                              #30

                              @ayush_mistral
                              Actually you set up a kit for QtCreator and then change the kit for your project. To make your kit work with the Qt you've downloaded just specify the correct qmake executable and a name that you'd recognize.
                              The kit your project uses is on the projects page, up-most, just below the name of the project. You have the kit name there and under it two buttons - build and run. Pointing at the kit name ("Qt 5.6 64 bit" in my case) will cause a down arrow to show next to the text. Clicking the arrow there's a context menu that has Change kit on it, and you just select the one you like. After changing the kit, do a full rebuild of your project.

                              Kind regards.

                              Read and abide by the Qt Code of Conduct

                              ? 1 Reply Last reply
                              0
                              • kshegunovK kshegunov

                                @ayush_mistral
                                Actually you set up a kit for QtCreator and then change the kit for your project. To make your kit work with the Qt you've downloaded just specify the correct qmake executable and a name that you'd recognize.
                                The kit your project uses is on the projects page, up-most, just below the name of the project. You have the kit name there and under it two buttons - build and run. Pointing at the kit name ("Qt 5.6 64 bit" in my case) will cause a down arrow to show next to the text. Clicking the arrow there's a context menu that has Change kit on it, and you just select the one you like. After changing the kit, do a full rebuild of your project.

                                Kind regards.

                                ? Offline
                                ? Offline
                                A Former User
                                wrote on last edited by
                                #31

                                @kshegunov

                                Hi,

                                I have the following settings in the newly created kit

                                Name- cppunit_qt
                                Device type - desktop
                                Device - Local PC
                                Compiler - GCC (x86 64bit in /usr/bin)
                                Debugger - System GDB at /usr/bin/gdb

                                Try to make clean and rebuild the project still the error is the same
                                Can you please tell me if I am missing something or doing something wrong?

                                Thanks and Regards
                                Ayush
                                Qt Version - Qt5.5.1GCC 64bit

                                jsulmJ 1 Reply Last reply
                                0
                                • ? A Former User

                                  @kshegunov

                                  Hi,

                                  I have the following settings in the newly created kit

                                  Name- cppunit_qt
                                  Device type - desktop
                                  Device - Local PC
                                  Compiler - GCC (x86 64bit in /usr/bin)
                                  Debugger - System GDB at /usr/bin/gdb

                                  Try to make clean and rebuild the project still the error is the same
                                  Can you please tell me if I am missing something or doing something wrong?

                                  Thanks and Regards
                                  Ayush
                                  Qt Version - Qt5.5.1GCC 64bit

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

                                  @ayush_mistral Which Qt version did you set in that kit?

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

                                  ? 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @ayush_mistral Which Qt version did you set in that kit?

                                    ? Offline
                                    ? Offline
                                    A Former User
                                    wrote on last edited by
                                    #33

                                    @jsulm

                                    I set 5.5.1

                                    kshegunovK 1 Reply Last reply
                                    0
                                    • ? A Former User

                                      @jsulm

                                      I set 5.5.1

                                      kshegunovK Offline
                                      kshegunovK Offline
                                      kshegunov
                                      Moderators
                                      wrote on last edited by kshegunov
                                      #34

                                      @ayush_mistral
                                      But with which qmake that is? If you go to the "Manage kits" page and look at the "Qt versions" tab you see that there's a qmake location column. You'd want to have the version you use to match the qmake you have in the manually installed directory. I have the following table:

                                      Auto-detected
                                          Qt 5.5.1 in PATH (System)         /usr/bin/qmake
                                      Manual
                                          Qt 5.6.0 (qt5)                    /home/nye/Programming/C++/qt/qt-5.6/qtbase/bin/qmake
                                          Qt 5.7.0 (qt-dev)                 /home/nye/Programming/C++/qt/qt-dev/qtbase/bin/qmake
                                      

                                      Any of those can be used to make a kit, however in your case you need to make sure to use the one you installed from the SDK package.

                                      Kind regards.

                                      Read and abide by the Qt Code of Conduct

                                      A ? 2 Replies Last reply
                                      0
                                      • kshegunovK kshegunov

                                        @ayush_mistral
                                        But with which qmake that is? If you go to the "Manage kits" page and look at the "Qt versions" tab you see that there's a qmake location column. You'd want to have the version you use to match the qmake you have in the manually installed directory. I have the following table:

                                        Auto-detected
                                            Qt 5.5.1 in PATH (System)         /usr/bin/qmake
                                        Manual
                                            Qt 5.6.0 (qt5)                    /home/nye/Programming/C++/qt/qt-5.6/qtbase/bin/qmake
                                            Qt 5.7.0 (qt-dev)                 /home/nye/Programming/C++/qt/qt-dev/qtbase/bin/qmake
                                        

                                        Any of those can be used to make a kit, however in your case you need to make sure to use the one you installed from the SDK package.

                                        Kind regards.

                                        A Offline
                                        A Offline
                                        asanka424
                                        wrote on last edited by
                                        #35

                                        @kshegunov sorry I was replyin from my phone and seems like reply gone to you.

                                        1 Reply Last reply
                                        0
                                        • kshegunovK kshegunov

                                          @ayush_mistral
                                          But with which qmake that is? If you go to the "Manage kits" page and look at the "Qt versions" tab you see that there's a qmake location column. You'd want to have the version you use to match the qmake you have in the manually installed directory. I have the following table:

                                          Auto-detected
                                              Qt 5.5.1 in PATH (System)         /usr/bin/qmake
                                          Manual
                                              Qt 5.6.0 (qt5)                    /home/nye/Programming/C++/qt/qt-5.6/qtbase/bin/qmake
                                              Qt 5.7.0 (qt-dev)                 /home/nye/Programming/C++/qt/qt-dev/qtbase/bin/qmake
                                          

                                          Any of those can be used to make a kit, however in your case you need to make sure to use the one you installed from the SDK package.

                                          Kind regards.

                                          ? Offline
                                          ? Offline
                                          A Former User
                                          wrote on last edited by A Former User
                                          #36

                                          @kshegunov

                                          Hi,

                                          In the QT versions tab of my newly created kit the path for the qmake is the same in the manually installed directory (/mistral/QT/5.5/gcc_64/bin/qmake). I also tried to change the qmake and added in the QT version present in path /usr/bin/qmake but still the error is same

                                          Thanks and Regards
                                          Ayush

                                          kshegunovK 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
                                          • Unsolved