64,661
社区成员
发帖
与我相关
我的任务
分享
typedef struct vertex
{
double x;
double y;
double z;
}vertex;
#include "vertex.h"
#include <vector>
using namespace std;
class building
{
public:
building();
int get_a();
private:
vector<vertex> v;
int a;
};
#include "building.h"
building::building()
{
a = 100;
}
int building::get_a()
{
return a;
}
#include "building.h"
class _declspec(dllexport) lib
{
public:
int get_bb();
building get_b();
private:
building b;
int bb;
};
#include "lib.h"
int lib::get_bb()
{
return bb;
}
building lib::get_b()
{
return b;
}
#include "lib.h"
#include <windows.h>
#include <stdlib.h>
#include <iostream.h>
int main()
{
lib l;
cout<<l.get_bb()<<endl;
return 0;
}
#ifndef lib_h_
#define lib_h_
#include "building.h"
#ifdef DLL_FILE
class _declspec(dllexport) lib //导出类point
#else
class _declspec(dllimport) lib //导入类point
#endif
{
public:
lib();//楼主没有构造;
int get_bb();
building get_b();
~lib();//楼主也没有析构;
private:
building b;
int bb;
};
#endif
#ifndef DLL_FILE
#define DLL_FILE
#endif
#include "stdafx.h"
#include "lib.h"
lib::lib()
{
bb=0;
}
int lib::get_bb()
{
return bb;
}
building lib::get_b()
{
return b;
}
lib::~lib()
{
}
#include "stdafx.h"
#include "lib.h"
#include <windows.h>
#include <iostream>
#pragma comment(lib,"lib4.lib");
using namespace std;
int main()
{
lib l;
cout<<l.get_bb()<<endl;
return 0;
}
以上是主要代码;