linux平台中的extern“c”行为

时间:2014-07-31 06:34:44

标签: c++ linux header-files extern

ScriptInterface.h

extern "C"
{
#include "kel.h"
#include "process.h"
#if defined(SIMULATOR_COMPILE_FROM_SCRIPTINTERFACE) || defined(SIMULATOR_WIN)
#include "sigtypes.h"
#endif
}

在Windows平台中,这不会出现任何错误(代码如下)

xyz.cpp

#include "kel.h"
#include "process.h"
#include "sigtypes.h"

#include "ScriptInterface.h"

它正在给出符号查找错误'在Linux平台上。外部' C'是否有任何不同的行为?在Linux平台上?

1 个答案:

答案 0 :(得分:0)

_Z16KEL_MEM_AllocateP19KEL_MEM_tPoolHandlej是一个非常严重的名称,几乎可以肯定,因为您在kel.h区块的之外包含了extern "C"

摆脱xyz.cpp中的前三个包含,只使用ScriptInterface.h中包含的内容(标记为非重复)。