Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我想在我的Qt项目中使用gdb,但我收到了;“拒绝许可”;消息_Qt_Memory Management_Gdb_Qt Creator_Valgrind - Fatal编程技术网

我想在我的Qt项目中使用gdb,但我收到了;“拒绝许可”;消息

我想在我的Qt项目中使用gdb,但我收到了;“拒绝许可”;消息,qt,memory-management,gdb,qt-creator,valgrind,Qt,Memory Management,Gdb,Qt Creator,Valgrind,我在Ubuntu上有一个Qt项目。我想使用valgrind分析。 我写了这个命令:gcc myApp.pro-o myApp-g 但是我收到了这个错误:无法识别文件格式 或者我写了这个命令:valgrind./myApp.pro 我收到此错误:/myApp.pro权限被拒绝 我能为valgrind分析做些什么(使用gdb) 感谢您的回复gcc希望传递源文件valgrind需要可执行文件。他们都不需要项目文件 首先,您需要像往常一样编译项目,以生成一个可执行文件。那么你应该像这样运行valgrin

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

但是我收到了这个错误:无法识别文件格式

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

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

我能为valgrind分析做些什么(使用gdb)


感谢您的回复

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

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

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

我理解你。非常感谢。但我收到了这个错误:--suppression=Qt47.supp.txt未找到命令。请删除命令中的换行符和“\”。将所有选项放在一行上。仍然存在相同的错误:myApp.exe:权限被拒绝:(我使用ubuntu所以可以是.exe?在ubuntu中应该是
/myApp
。exe从哪里来?你执行的确切命令是什么?你的可执行文件的确切名称是什么?非常感谢,伙计。我找到了可执行文件目录。谢谢。现在需要找到崩溃或内存泄漏的地方。哪个函数或行?我如何理解D