首先引入extern"C"的官方解释 extern "C" is meant to be recognized by a C++ compiler and to notify the compiler that the noted function is (or to be) compiled in C style. Take an example, if you are working on a C++ project but it also deals with
1.extern 修饰一个变量,告诉编译器这个变量在其他地方定义,编译器不会给出变量未定义的警告. extern tells the compiler that the variable is defined somewhere else, so it doesn't complain about it being undefined.--includes.hextern int count;--main.cpp#include "includes.h"int count = 4;--