草庐IT

printTheLogs

全部标签

android - 如何在 ANDROID NDK 中从 C 文件调用 CPP 文件中的函数,反之亦然?

我无法从c文件调用cpp文件中的函数,也无法从ndk本身的cpp文件调用c文件中的函数。我也尝试过使用extern"C"{}。粘贴我试过的代码以供引用。CFileCallingCpp.c:#include"CFileCallingCpp.h"//#include"custom_debug.h"#include"CppFile.h"voidtempFunc(){}voidprintTheLogs(){//ItsnotpossibletomakeuseoftheCPPclassincfile//CCustomDebugcls;//cls.printErrorLog("Thisistheer