• 7059阅读
  • 10回复

【提问】error LNK2001的解决方法是……? → 问题已解决 [复制链接]

上一主题 下一主题
离线guyansrg
 

只看楼主 倒序阅读 楼主  发表于: 2006-09-21
最近做了一个简单的程序,编译的时候老是出现error LNK2001错误。
哪个高手能帮忙解决一下(编程环境 WinXP + Qt3.3.6)

出错信息是:
  link /NOLOGO delayimp.lib /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:windows /LIBPATH:"C:\Qt\3.3.6\lib" /OUT:Attendance.exe @C:\DOCUME~1\SUNRON~1\LOCALS~1\Temp\nm103.tmp
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from comdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from oleaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winmm.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from wsock32.dll
LINK : warning LNK4199: /DELAYLOAD:winspool.dll ignored; no imports found from winspool.dll
main.obj : error LNK2001: unresolved external symbol "public: __thiscall Attendance::Attendance(class QWidget *,char const *,unsigned int)" (??0Attendance@@QAE@PAVQWidget@@PBDI@Z)
Attendance.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : リターン コード '0x460'
Stop.
[ 此贴被guyansrg在2006-10-21 10:10重新编辑 ]
离线xuxinshao

只看该作者 1楼 发表于: 2006-09-22
这样的问题是没有找到动态库文件
离线guyansrg

只看该作者 2楼 发表于: 2006-09-22
好像不是那么一回事吧
离线浪漫天使
只看该作者 3楼 发表于: 2006-09-26
error LNK2001: unresolved external symbol "public: __thiscall Attendance::Attendance(class QWidget *,char const *,unsigned int)" (??0Attendance@@QAE@PAVQWidget@@PBDI@Z)
你写了构造函数了吗?
离线fanyu
只看该作者 4楼 发表于: 2006-10-11
楼主什么编译器?
离线khosha
只看该作者 5楼 发表于: 2006-10-12
貌似申明了函数,但是没有写函数的定义,所以链接器找不到函数的定义体
离线guyansrg

只看该作者 6楼 发表于: 2006-10-12
我用的是 nmake(VC6)

这是头文件→
#ifndef ATTENDANCE_H
#define ATTENDANCE_H

#include <qvariant.h>
#include <qpixmap.h>
#include <qwidget.h>
#include <qtable.h>
#include <qpushbutton.h>
#include <qlineedit.h>


class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QTable;
class QPushButton;
class QLineEdit;

class Attendance: public QWidget
{
  Q_OBJECT
public:
  Attendance(QWidget* parent = 0, const char *name = 0 , WFlags fl=0);
  ~Attendance();

  QTable* tableResult;
  QPushButton* pbtToday;
  QPushButton* pbtHistory;
  QLineEdit* lineEditEmployeeCD;
  QPushButton* pbtSearch;
  QPushButton* pbtQuit;

public slots:
  virtual void Today();
  virtual void History();
  virtual void Search();

protected:
  QGridLayout* AttendanceLayout;
  QVBoxLayout* layout2;
  QSpacerItem* spacer1;

protected slots:
  virtual void languageChange();

private:
  QPixmap image0;
  QPixmap image1;

};

#endif // ATTENDANCE_H
离线guyansrg

只看该作者 7楼 发表于: 2006-10-12
谁能帮我找出错误?
离线cavendish

只看该作者 8楼 发表于: 2006-10-16
.cpp呢?

你的整个编译过程呢?
离线guyansrg

只看该作者 9楼 发表于: 2006-10-19
东西太多了
离线guyansrg

只看该作者 10楼 发表于: 2006-10-20
问题解决了,我又重新把程序整理了一遍,原来写得太乱了
可能是中间夹了些不该有的代码
快速回复
限100 字节
 
上一个 下一个