To create the DLL export library, select "setting..." from the Project menu. Select the C/C++ tab. Append, or insert, ",DLLDIR_EX" (without the quotation marks) to the Preprocessor Definition text box. Then click OK. This will prevent compiler assumptions and warnings。
要创建DLL导出库中,选择从项目菜单中的“设置...”。选择C/ C+ +选项卡。追加或插入“,DLLDIR_EX”(不带引号)到预处理器定义文本框。然后单击确定。这将防止编译器假设和警告。
如:
#ifndef _MYSERIALDLL_IMP
#define MYSERIALAPI __declspec(dllimport)
#else
#define MYSERIALAPI __declspec(dllexport)
#endif
需要将",_MYSERIALDLL_IMP"(不带引号)加入到预处理器定义文本框,警告才会消失。
本文详细介绍了如何通过设置预处理器定义文本框来创建DLL导出库,并解释了如何将特定字符串加入其中以避免编译器的假设和警告。

3152

被折叠的 条评论
为什么被折叠?



