首页 > 编程知识 正文

c语言的标识符由什么组成,vs2017未定义标识符怎么解决

时间:2023-05-05 13:39:39 阅读:50064 作者:1412

源代码: dll.h # ifndef _ dll _ h _ # define _ dll _ h _ # if building _ dll # define dlimport _ _ declspec (.

源代码:

dll.h

#ifndef _DLL_H_

#define _DLL_H_

#if BUILDING_DLL

# define dllimport _ _ declspec (dll export ) )

#else /清爽仔海豚Not BUILDING_DLL清爽仔海豚/

# define dllimport _ _ declspec (dllimport )

#endif /清爽的小海豚Not BUILDING_DLL清爽的小海豚/

dlimportintx(inta,int b );

#endif /清爽的小海豚_DLL_Hjldhd/

------------- -请参阅

dllmain.c

/清爽的小海豚replace ' dll.h ' withthenameofyourheader清爽的小海豚/

#include 'dll.h '

#包含

#包含

#包含

dllimportintx(inta,int b ) )。

{

int c;

c=a b;

返回c;

}

boolapientrydllmain (hinstancehinst /清爽的幼海豚Library instance handle .清爽的幼海豚/

{

交换机(reason )

{

case DLL_PROCESS_ATTACH:

布雷克;

case DLL_PROCESS_DETACH:

布雷克;

case DLL_THREAD_ATTACH:

布雷克;

case DLL_THREAD_DETACH:

布雷克;

}

/清爽的小海豚Returns TRUE on success,FALSE on failure清爽的小海豚/

返回真;

}

无法由Intellisense:mgdmj宣布为“dllimport”的撒娇铃

不允许errorc 2491:“x”: dllimport可接受的铃mgdmj

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。