我想在我的Qt项目中使用gdb。但是我收到了“Permission denied”消息?

时间:2013-07-29 07:25:59

标签: qt memory-management gdb qt-creator valgrind

我在Ubuntu上有一个Qt项目。我想用valgrind分析。 我写了这个命令: gcc myApp.pro -o myApp -g

但我收到此错误:文件格式无法识别

或者我写了这个命令: valgrind ./myApp.pro

我收到此错误: ./ myApp.pro权限被拒绝

我可以为valgrind分析做什么(使用gdb)......

感谢您的回复

1 个答案:

答案 0 :(得分:1)

gcc期望传递源文件。 valgrind期望可执行文件。他们都不期望项目文件。

首先,您需要像往常一样编译项目以生成可执行文件。然后你应该像这样运行valgrind:

valgrind -q --tool=memcheck --leak-check=full --leak-resolution=low \
   --suppressions=Qt47supp.txt ./[your-app-target-name]