extern "C"说明:使C++能够调用C写作的库文件的一个手段

#ifdef __cplusplus
extern "C"
{
#endif

#include "SDL.h"

#ifdef __cplusplus
}
#endif

  __cplusplus是cpp中的自定义宏。

  C和C++对函数的处理方式是不同的,extern "C"是使C++能够调用C写作的库文件的一个手段,如果要对编译器提示使用C的方式来处理函数的话,那么就要使用extern "C"来说明。

原文地址:https://www.cnblogs.com/mathyk/p/10381971.html