初学qt,遇到这问题太郁闷了,求教高手啊。 先说现象:编译链接后提示以下错误: 1.main.obj:-1: 错误:LNK2019: 无法解析的外部符号 "public: __cdecl GoToCellDialog::GoToCellDialog(class QWidget *)" (??0GoToCellDialog@@QEAA@PEAVQWidget@@@Z),该符号在函数 main 中被引用 2.debug\ch03_1.exe:-1: 错误:LNK1120: 1 个无法解析的外部命令 新建了一个gui程序,窗口继承自QDialog,不用QtCreator创建gui,代码是《C++ GUI Programming with Qt 4,Second Edition》第二章的FindDialog例子程序,运行一切正常。 然后再新建GoToCellDialog(这是第二章FindDialog的下一个例子),建好后未添加任何代码,然后在main.cpp中显示该窗口。GoToCellDialog的代码为: 头文件: #ifndef GOTOCELLDIALOG_H #define GOTOCELLDIALOG_H #include <QDialog> class GoToCellDialog : public QDialog { Q_OBJECT public: explicit GoToCellDialog(QWidget *parent = 0); signals: public slots: }; #endif // GOTOCELLDIALOG_H 源文件: #include "gotocelldialog.h" GoToCellDialog::GoToCellDialog(QWidget *parent) : QDialog(parent) { } 在官网下载的Qt 5.1.1 for Windows 64-bit (VS 2012, 525 MB) (Info) 编译环境为:win8 + QtCreator 2.7.2 + Qt 5 + VS2012的编译
补充:移动开发 , Qt
上一个:ListView无法获取相应的值,求助下一个:关于oauth2.0