Setup GDB with QtCreator

前端 未结 1 1975
广开言路
广开言路 2021-01-01 23:12

I have a simple project using OpenCV and cmake, and has two source files only segmentation.h and segmentation.cpp.

Here is the cmakefile:

project(Seg         


        
相关标签:
1条回答
  • 2021-01-01 23:45

    Go to Project, Run and in the run settings check the box that say Run in Terminal. It will make QT Creator launch the program inside a XTerm (default) that plays well with gdb and makes the &"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n" problem go away.

    By default, when launching the debugger, it will also bring QT Creator to the foreground and thus hide the terminal that was brought up. To stop this behaviour go to: Tools, Options, Debugger. In the General tab, untick the check box that say Bring Qt Creator to foreground when application interrupts.

    If you want to change the terminal, you can do so in Options, Environment. In the System section the Terminal to what you want. For native Ubuntu / Gnome terminal, set it to /usr/bin/gnome-terminal -x. The parameters in this setting must tell the terminal to execute an external command or program.

    0 讨论(0)
提交回复
热议问题