经验证:下机制可行
Here is a setup that allows C++ to call C.
Maybe this method is appropriate for your need :
1) use the "not using precompiled headers" option
2) sample C header file (cheader.h)
#ifdef __cplusplus
extern "C" {
#endif
//
//
void cfun();
//
//
#ifdef __cplusplus
}
#endif
3) sample C file (myc.c)
#include "cheader.h"
//
void cfun()
{
}
4) in the CPP file where you want to call C function :
#include "cheader.h"
//
//
//
//
cfun();