c++ - GDB 不会在 Qt 项目中的断点处停止
问题描述
创建了默认Qt Widgets Application
项目,在所有 func 行放置了断点,main
但它们都没有被触发F5
(启动项目的启动调试)\ F10(在 main 上启动和中断)。任何其他项目都会发生同样的事情。
代码:
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
我的工具包屏幕截图(所有编译器(包括选择)都由 Qt 自动检测并由 Qt Installer 提供)。
我的.pro
文件:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
解决方案
推荐阅读
- python - 从我的程序输出重定向到的文件中读取
- azure-active-directory - Azure B2C - SAML ClaimsProvider 下游 - 注入断言或声明
- indexing - Python 3.x 如何在 for 循环中访问我的 i 元素索引之前的索引元素?
- javascript - 如何显示来自(Meteor)的数据反应 findOne?
- swift - 以编程方式添加到 collectionviewcell 时未启用按钮
- php - 如何根据codeigniter中的recno移动到下一个条目
- node.js - 自定义猫鼬种群
- f# - 将 C# Array 类型的 web builder 转换为 F#
- java - 未找到 Jmeter java
- swift - NSTableView 不会调用 viewForTableColumn