当前位置:编程学习 > wap >>

求助添加自定义窗体时出现未找到main.obj的问题

--------------------编程问答--------------------
引用 楼主 hypeaches 的回复:
初学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的编译


问题已经解决了,clean makefile即可,结贴了 --------------------编程问答-------------------- 一楼方法能够解决问题,但我不知道怎么给分,没办法结贴。
以下再有回复不再给分,请注意。
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,