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"(不带引号)加入到预处理器定义文本框,警告才会消失。