基本的c++ link错误2019,请教各位高手,急
su 2005-07-02 02:25:21 一个简单的类怎么出的link错误2019,我做的步骤和编译器提示如下,希望各位高手能给我帮助
错误全文如下:HELLOWORLDPLUS error LNK2019: unresolved external symbol "public: static class HTTPTrans * __cdecl HTTPTrans::NewL(class CCoeControl *)" (?NewL@HTTPTrans@@SAPAV1@PAVCCoeControl@@@Z) referenced in function "public: virtual void __thiscall CHelloWorldPlusAppUi::ConstructL(void)" (?ConstructL@CHelloWorldPlusAppUi@@UAEXXZ)
1.定义一个c++的头文件和源文件
#ifndef HTTPTrans_H
#define HTTPTrans_H
#include <es_sock.h>
#include <in_sock.h>
#include <e32std.h>
#include <f32file.h>
#include <s32file.h>
#include <coecntrl.h>
class HTTPTrans :public CActive
{
public:
HTTPTrans(void);
virtual ~HTTPTrans(void);
static HTTPTrans* NewL(CCoeControl* iAppView);
static HTTPTrans* NewLc(CCoeControl* iAppView);
};
#endif
*************************************************
#include <e32base.h>
#include <e32std.h>
#include "httptrans.h"
HTTPTrans::HTTPTrans(void): CActive(EPriorityStandard)
{
}
HTTPTrans::~HTTPTrans(void)
{
}
HTTPTrans* HTTPTrans::NewL(CCoeControl* iAppView)
{
return NULL;
}
HTTPTrans* HTTPTrans::NewLc(CCoeControl* iAppView)
{
return NULL;
}
2.在helloworldbasic中例子中的ui类中加入 FORWARD DECLARATIONS class HTTPTrans;
3.在ui类中加入成员变量HTTPTrans* trans;
4.在ui类ConstructL()中加入trans = HTTPTrans::NewL((CCoeControl*)iAppView);
5.编译通过,不过链接的时候报错2019