我在Ubuntu上有一个Qt项目。我想用valgrind分析。 我写了这个命令: gcc myApp.pro -o myApp -g
但我收到此错误:文件格式无法识别
或者我写了这个命令: valgrind ./myApp.pro
我收到此错误: ./ myApp.pro权限被拒绝
我可以为valgrind分析做什么(使用gdb)......
感谢您的回复
答案 0 :(得分:1)
gcc
期望传递源文件。 valgrind
期望可执行文件。他们都不期望项目文件。
首先,您需要像往常一样编译项目以生成可执行文件。然后你应该像这样运行valgrind:
valgrind -q --tool=memcheck --leak-check=full --leak-resolution=low \
--suppressions=Qt47supp.txt ./[your-app-target-name]