vs2012 C++ 使用dll到处类的有关问题,可以调用dll中的函数,不能调用dll中的类

vs2012 C++ 使用dll到处类的问题,可以调用dll中的函数,不能调用dll中的类
各位,我自己写了一个dll,定义了一个导出类Ctestdll和一个到处函数Func1,头文件如下testdll.h,
-------------------------------------------------------------------------------------------------------------------------------------------
// 下列 ifdef 块是创建使从 DLL 导出更简单的
// 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 TESTDLL_EXPORTS
// 符号编译的。在使用此 DLL 的
// 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
// TESTDLL_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
// 符号视为是被导出的。


#ifdef TESTDLL_EXPORTS
#define TESTDLL_API   __declspec(dllexport)
#else
#define TESTDLL_API   __declspec(dllimport)
#endif

// 此类是从 testdll.dll 导出的
class TESTDLL_API Ctestdll {
public:
Ctestdll(void);
// TODO: 在此添加您的方法。
int addFunc(int x,int y);
};

extern TESTDLL_API int ntestdll;

TESTDLL_API int fntestdll(void);
TESTDLL_API int Func1(int x, int y);
-----------------------------------------------------------------------------------
源文件 testdll.cpp如下:
----------------------------------------------------------------------------------
#include "stdafx.h"
#include "testdll.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// 唯一的应用程序对象

CWinApp theApp;

using namespace std;

int Ctestdll::addFunc(int x, int y)
{
return x+y;
}
int Func1(int x, int y)
{
return x+y;
}
--------------------------------------------------------------------------------
另外创建一个win32 console 程序,代码如下:
---------------------------------------------------------------------------------------
// Demo.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;
#include "..//testdll//testdll.h"

//添加依赖的dll
#pragma comment(lib,"../Debug/testdll.lib")

int _tmain(int argc, _TCHAR* argv[])
{
int a=2;
int b=3;
Ctestdll *ct = new Ctestdll();
cout<<Func1(a,b)<<endl;
//cout<<ct->addFunc(a,b)<<endl;
getchar();
return 0;
}
已经在 :属性----链接器----常规----附加库目录 中加入了dll的lib目录。
编译出现如下问题:
Demo.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall Ctestdll::Ctestdll(void)" (__imp_??0Ctestdll@@QAE@XZ),该符号在函数 _wmain 中被引用
2>D:\TradeSystem\02开发\project\Demo\Debug\Demo.exe : fatal error LNK1120: 1 个无法解析的外部命令
,奇怪的是,如果我把 ”Ctestdll *ct = new Ctestdll();“这一句注释掉,值调用“Func1(a,b)”  完全没有问题。
所以看起来好象是可以调用dll中的函数,但是不能调用dll中的类,请问,这个如何解决???????
------解决方案--------------------
你没有定义构造函数。