Linux 警告:GDB:无法设置控制终端:参数无效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3869380/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
warning: GDB: Failed to set controlling terminal: Invalid argument
提问by JoelFan
I'm using Qt Creator on Ubuntu to develop C. Whenever I run with the debugger, I get the message warning: GDB: Failed to set controlling terminal: Invalid argument
. This happens even with a hello world
program. How can I solve this?
我在 Ubuntu 上使用 Qt Creator 来开发 C。每当我使用调试器运行时,我都会收到消息warning: GDB: Failed to set controlling terminal: Invalid argument
。即使使用hello world
程序也会发生这种情况。我该如何解决这个问题?
采纳答案by zwol
This is a bug in Qt Creator, which is not invoking GDB correctly (either inside a pseudoterminal, or with command line arguments that tell it not to expect to be run inside a pseudoterminal). It is also a bug in GDB, which could figure out for itself that it wasn't being run inside a pseudoterminal and behave accordingly. I suspect the GDB maintainers will take the position that this is Qt Creator's fault, and vice versa, alas.
这是 Qt Creator 中的一个错误,它没有正确调用 GDB(在伪终端内,或者使用命令行参数告诉它不要期望在伪终端内运行)。这也是 GDB 中的一个错误,它可以自己找出它没有在伪终端内运行并相应地进行操作。我怀疑 GDB 维护者会认为这是 Qt Creator 的错,反之亦然,唉。
There is a claimed workaround here: http://www.qtforum.org/article/31905/debugging-qt-application-on-linux.htmlbut it sounds kinda dodgy to me.
这里有一个声称的解决方法:http: //www.qtforum.org/article/31905/debugging-qt-application-on-linux.html但对我来说听起来有点狡猾。
回答by Harvey
Whether this warning is a bug or not, it is informative as a clue that you have the option to tell QtCreator to cause your program to run in a terminal which may be useful for debug output. See Setup GDB with QtCreatorto enable this option.
无论此警告是否是错误,它都可以作为提示您可以选择告诉 QtCreator 使程序在终端中运行,这可能对调试输出有用。请参阅使用 QtCreator 设置 GDB以启用此选项。
If you don't want a terminal open, then just ignore the warning.
如果您不想打开终端,请忽略警告。