C/C++混合编程小贴士

  .c文件被.cpp文件调用时,需要在头文件中添加如下定义:

#ifdef __cplusplus
extern "C" {
    
    
#endif

#ifdef __cplusplus
}
#endif

  否则,可能会提示undefined inference to “_interface”,未定义的引用的Error。

猜你喜欢

转载自blog.csdn.net/qq_33475105/article/details/118370790