请教C++和C混合编程问题

如题所述

上面的错误是externBOOLInsertLog(constchar*szLog);已经在其他地方定义了。CompilerErrorC2732linkagespecificationcontradictsearlierspecificationfor'function'Thefunctionisalreadydeclaredwithadifferentlinkagespecifier.PossiblecauseIncludefileswithdifferentlinkagespecifiers.Changetheexternstatementssothatthelinkagesagree.你试着把#include"proj.h"加到函数extern"C"BOOLInsertLog(constchar*szLog){……}试试。如果还是不行,你试着把#include"proj.h"文件中的externBOOLInsertLog(constchar*szLog);改为BOOLInsertLog(constchar*szLog);试一试。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-07-16
extern "C"
相似回答