请看看静态库Dll问题
我写了一个静态库的Dll,并继承了CListCtrl
<<<<<<<<<CmControl.h>>>>>>>>
#pragma once
#ifndef Define_Dll
#define Define_Dll __declspec(dllimport)
#endif
class Define_Dll ListCtrl:public CListCtrl
{
public:
void rxgmoral();
};
<<<<<<<<<<CmControl.Cpp>>>>>>>>>>>
#define Define_Dll __declspec(dllexport)
#include "stdafx.h"
#include "CmControl.h"
void ListCtrl::rxgmoral()
{
AfxMessageBox(_T("yyyyy"));
}
************Test应用程序调用*******************
#include "CmControl.h"
#pragma comment(lib,"Share.lib")
.......................
ListCtrl asd;
报错如下:
Compiling...
TestDlg.cpp
e:\备份程序库\studio\test\test\cmcontrol.h(6) : warning C4275: non dll-interface class 'CListCtrl' used as base for dll-interface class 'ListCtrl'
d:\microsoft visual studio\vc\atlmfc\include\afxcmn.h(248) : see declaration of 'CListCtrl'
e:\备份程序库\studio\test\test\cmcontrol.h(5) : see declaration of 'ListCtrl'
Generating Code...
Compiling...
Test.cpp
e:\备份程序库\studio\test\test\cmcontrol.h(6) : warning C4275: non dll-interface class 'CListCtrl' used as base for dll-interface class 'ListCtrl'
d:\microsoft visual studio\vc\atlmfc\include\afxcmn.h(248) : see declaration of 'CListCtrl'
e:\备份程序库\studio\test\test\cmcontrol.h(5) : see declaration of 'ListCtrl'
Generating Code...
Linking...
Test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ListCtrl::~ListCtrl(void)" (__imp_??1ListCtrl@@UAE@XZ) referenced in function "public: virtual __thiscall CTestDlg::~CTestDlg(void)" (??1CTestDlg@@UAE@XZ)
TestDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ListCtrl::~ListCtrl(void)" (__imp_??1ListCtrl@@UAE@XZ)
TestDlg.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ListCtrl::ListCtrl(void)" (__imp_??0ListCtrl@@QAE@XZ) referenced in function "public: __thiscall CTestDlg::CTestDlg(class CWnd *)" (??0CTestDlg@@QAE@PAVCWnd@@@Z)
E:\备份程序库\Studio\Test\Debug\Test.exe : fatal error LNK1120: 2 unresolved externals
Build log was saved at "file://e:\备份程序库\Studio\Test\Test\Debug\BuildLog.htm"
我的"鸟"文不好,请问错那了
谢谢:)