送分贴~~ 解决马上揭贴

nonowhy 2004-09-17 04:57:00
如何在vc的dll工程里自定义一个导出类
我在头文件中声明 :
#define DllExport _declspec(dllexport)
DllExport class Expclass
{
...........
}
然后在类的.cpp文件里象非dll工程一样:
class Expclass
{

}
编译错误:

f:\vpn\testprojects\expclass\declfun.h(17) : warning C4091: '__declspec(dllexport ) ' : ignored on left of 'class Expclass' when no variable is declared
F:\VPN\TestProjects\Expclass\ExpclassImp.cpp(3) : warning C4091: 'extern ' : ignored on left of 'class Expclass' when no variable is declared
F:\VPN\TestProjects\Expclass\ExpclassImp.cpp(5) : error C2011: 'Expclass' : 'class' type redefinition
Error executing cl.exe.
还有那个warning 什么意思的???????????????????????谢谢~~~
...全文
58 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rivershan 2004-09-17
  • 打赏
  • 举报
回复
class DllExport Expclass

顺序写错了。。。
flyelf 2004-09-17
  • 打赏
  • 举报
回复
AFX_EXT_CLASS
nonowhy 2004-09-17
  • 打赏
  • 举报
回复
up!

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧