level 6
Lion1942
楼主
如下,从动态链接库中导出类时提示错误,请教下是什么原因?
DLL.H
#ifdef DLL_API
#else
#define DLL_API _dec
lsp
ec(dllimport)
DLL_API int sum(int a,int b);
DLL_API int ave(int a,int b);
class DLL_API point{
public:
int output(int a,int b);
};
#endif
DLL.CPP
#ifndef DLL_API
#define DLL_API _declspec(dllexport)
#include "DLL11.h"
DLL_API int sum(int a,int b){ return a+b;}
DLL_API int ave(int a,int b){return a*b;}
DLL_API int point::output(int a,int b){return a-b;};
#endif
报错误:dll11.cpp(13) : error C2653: 'point' : is not a class or namespace name
2012年05月04日 06点05分
1
DLL.H
#ifdef DLL_API
#else
#define DLL_API _dec
lsp
ec(dllimport)
DLL_API int sum(int a,int b);
DLL_API int ave(int a,int b);
class DLL_API point{
public:
int output(int a,int b);
};
#endif
DLL.CPP
#ifndef DLL_API
#define DLL_API _declspec(dllexport)
#include "DLL11.h"
DLL_API int sum(int a,int b){ return a+b;}
DLL_API int ave(int a,int b){return a*b;}
DLL_API int point::output(int a,int b){return a-b;};
#endif
报错误:dll11.cpp(13) : error C2653: 'point' : is not a class or namespace name