|
发表于 2013-6-3 22:14:00
|
显示全部楼层
不知道是不是你的意思~~
头文件:s.h 下面是代码:
#ifndef __TEST_H__
#define __TEST_H__
#include "iostream"
#include "string"
using namespace std;
#ifdef DLLCLASS_EXPORTS
#define EXT_CLASS _declspec(dllexport)
#else
#define EXT_CLASS _declspec(dllimport)
#endif
class EXT_CLASS Test
{
public:
void display(string str);
int add(int ,int );
private:
int a;
int b;
};
#endif //__TEST_H__
s.cpp代码如下:
#define DLLCLASS_EXPORTS
#include "s.h"
void Test::display(string str)
{
cout << str << endl;
}
int Test::add(int add1,int add2)
{
return add1 + add2;
}
如果想dll有地址的话要写def文件~~试试~~希望对你有帮助~~{:7_155:}
|
|