我有一个 Autotools + libtool 项目,我正在尝试为其设置 Qt Creator。
我通过 Import project --> Import Existing Project
创建了项目。构建 (make
) 并运行指定的可执行文件工作正常,但是当我尝试调试时出现错误
not in executable format: File format not recognized
最佳答案
您需要使用 libtool --mode=execute gdb your_program
进行调试,参见 http://www.gnu.org/software/libtool/manual/html_node/Debugging-executables.html
对于 Qt Creator 你可以创建一个脚本
#!/bin/bash
exec libtool --mode=execute /usr/bin/gdb "$@"
在 Options --> Build & Run --> Debuggers
中指定它(然后在 Kits
页面上选择调试器)
同时检查项目运行设置中的Run In Terminal
关于c++ - 如何在 Qt Creator 中调试 libtool 可执行文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37688369/