什么是declspec(dllexport) [英] what is declspec(dllexport)

查看:76
本文介绍了什么是declspec(dllexport)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为vc ++的新手,任何人都可以为我提供以下代码:

As iam new to vc++ , can any one help me for below code:

#ifdef _xyzDLL
#define xyzDLL_EXP __declspec(dllexport)
#else
#define xyzDLL_EXP __declspec(dllimport)
#endif



谢谢



Thanks

推荐答案

好...这里的简短说明:

Ok... here''s brief explanation:

#ifdef _xyzDLL //This allows you to use the same header for importing/exporting from a dll (in this case, if you define _xyzDLL you export functions)
#define xyzDLL_EXP __declspec(dllexport) //This defines all of your classes/functions in the file as "dll exports" and is used when you''re compiling a dll
#else
#define xyzDLL_EXP __declspec(dllimport) //This defines all of your classes/functions in the file as "dll imports" and is used when you''re compiling an executable (therefore you''re importing the header classes/functions)
#endif




绝对不是包容性的,但这应该使您澄清所要询问的内容以及代码的目的是什么.为了进一步澄清,您应该在某个时候阅读__declspec和dllexport/dllimport的文档.




By all means not inclusive but that should clear you up as far as what you''re asking and what the purpose of the code is. For further clarification, you should at some point go and read the documentation for __declspec and dllexport/dllimport.


检查msdn以获取信息:
http://msdn.microsoft.com/en-us/library/dabb5z75%28v = vs.80%29.aspx [ ^ ]

祝你好运!
Check msdn for info:
http://msdn.microsoft.com/en-us/library/dabb5z75%28v=vs.80%29.aspx[^]

Good luck!


这篇关于什么是declspec(dllexport)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆