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 install valgrind in Qt?
Forum Updated to NodeBB v4.3 + New Features

how to install valgrind in Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 1.1k 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.
  • T Offline
    T Offline
    thomasGl
    wrote on last edited by
    #1

    Hi guys. I am trying to run Valgrind with qt. I downloaded the zip file from valgrind and installed it in WSL. But it does not work with qt application because it cant find QMainWindow and stuff. There is an option in Qt to run Valgrind from How can i install valgrind with qt? I have no .exe file 1.png 2.png Qt. How can i install valgrind with qt? I have no .exe file.

    Its the Valgrind folder in the pic. But i cant find the .exe

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Valgrind does not work on Windows.

      (Z(:^

      JonBJ 1 Reply Last reply
      1
      • sierdzioS sierdzio

        Valgrind does not work on Windows.

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by JonB
        #3

        @sierdzio
        But the OP is running under/over WSL? I thought the point of WSL is that you can run stuff which would not be available for Windows so long as it's available in the Linux running on WSL?

        @thomasGl
        Have you read e.g. https://stackoverflow.com/questions/40355474/valgrind-does-not-work-with-wsl ? Or maybe you are saying you have got valgrind itself installed and working? Your screenshot shows an incorrect path to Valgrind executable? Is that path a directory, does it have an executable inside it? And I don't know how this relates to a compilation failure where it can't find a .h file. I don't know why you are attempting to execute a .cpp file, and I don't know why you seem to be doing stuff as root user.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thomasGl
          wrote on last edited by
          #4

          Its not only with Valgrind. I am trying to make a .exe file with "g++ (MinGW.org GCC-6.3.0-1) 6.3.0" and i am getting the same error. g++ main.cpp -o main
          main.cpp:1:24: fatal error: QApplication: No such file or directory
          #include <QApplication>

          JonBJ Pl45m4P 2 Replies Last reply
          0
          • T Offline
            T Offline
            thomasGl
            wrote on last edited by
            #5
            #include <QApplication>
            #include <iostream>
            
            int main(void)
            {
            }
            I am trying it with that code first. Cant find QApplication.
            1 Reply Last reply
            0
            • T Offline
              T Offline
              thomasGl
              wrote on last edited by thomasGl
              #6

              i am running wsl under windows 10. I am in the right path : 36d68cc3-a90a-4648-8214-1648ea90a897-grafik.png . Thats the path from the second Code.

              1 Reply Last reply
              0
              • T thomasGl

                Its not only with Valgrind. I am trying to make a .exe file with "g++ (MinGW.org GCC-6.3.0-1) 6.3.0" and i am getting the same error. g++ main.cpp -o main
                main.cpp:1:24: fatal error: QApplication: No such file or directory
                #include <QApplication>

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by JonB
                #7

                @thomasGl said in how to install valgrind in Qt?:

                I am trying to make a .exe file with "g++ (MinGW.org GCC-6.3.0-1) 6.3.0" and i am getting the same error

                I don't use Windows, WSL or MinGW. But as far as I know if you are using MinGW then you are compiling for Windows, and everything about WSL is irrelevant/ignored. And then you won't have valgrind.

                Unless I am mistaken, you must pick either to compile for WSL/Linux and use Linux gcc/g++ to produce a Linux executable, in which case you can install valgrind there and use it, or to compile for Windows and use use Windows MinGW to produce a Windows executable, in which case you cannot use valgrind. You need to pick one or the other way of compiling and stick with it, not mix them. Decide on your target user to determine which one to use.

                1 Reply Last reply
                1
                • T thomasGl

                  Its not only with Valgrind. I am trying to make a .exe file with "g++ (MinGW.org GCC-6.3.0-1) 6.3.0" and i am getting the same error. g++ main.cpp -o main
                  main.cpp:1:24: fatal error: QApplication: No such file or directory
                  #include <QApplication>

                  Pl45m4P Offline
                  Pl45m4P Offline
                  Pl45m4
                  wrote on last edited by Pl45m4
                  #8

                  @thomasGl said in how to install valgrind in Qt?:

                  g++ main.cpp -o main
                  main.cpp:1:24: fatal error: QApplication: No such file or directory
                  #include <QApplication>

                  As @SGaist said in your topic here, you can't just gcc compile your files like that. You need to link the Qt library and set appropriate compiler flags.


                  If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                  ~E. W. Dijkstra

                  1 Reply Last reply
                  1
                  • T Offline
                    T Offline
                    thomasGl
                    wrote on last edited by
                    #9

                    How can i do that?

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

                      Either provides the required arguments for the compiler and linker by hand or use a project management system such as cmake.

                      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
                      1

                      • Login

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