how to install valgrind in Qt?
-
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
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
-
Valgrind does not work on Windows.
-
@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. -
-
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>@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.
-
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>@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.
-
Either provides the required arguments for the compiler and linker by hand or use a project management system such as cmake.