【发布时间】:2014-04-02 23:07:14
【问题描述】:
在 Qt creator 中调试 C++ 代码时出现以下错误
ptrace: Operation not permitted.
Could not attach to the process. Make sure no other debugger traces this process.
Check the settings of
/proc/sys/kernel/yama/ptrace_scope
For more details, see /etc/sysctl.d/10-ptrace.conf
这里找到了一个临时解决方案:Receiving error while trying to debug in QtProject
-
临时解决方案(重启后无法继续使用):
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
但是每次启动 PC 使用 Qt 时,都很难在终端中运行相同的代码。
What is the permanent solution for this?
【问题讨论】:
-
您可以将其添加到自动启动中(例如,将其放入
/etc/rc.local)。 -
只需删除 sudo。
/etc/rc.local以超级用户权限执行。
标签: c++ qt linux-kernel qt5 linux-mint