我有一个C动态库,由于一些需求的变化,我不得不做一些重构。动态库中链接问题,同时混合C C++代码
我在一个c文件中有以下代码。
__attribute__((noinline))
static void *find_document(...)
{
...
}
bool docuemnt_found(const char *name) {
...
find_document(...);
...
}
我在不同的cpp文件中分隔了docuemnt_found()函数。现在docuemnt_found()函数无法链接到find_document()方法?
我试着为c文件创建头文件,然后使用extern "C"
包含头文件,但没有奏效。
我想保持find_document()内联。这里有什么缺失或有什么问题吗?
我正在使用GCC 4.2 – MacGeek
查看函数声明的'static'的含义。然后删除“静态”一词。 –
aa !!!雅。谢谢。 – MacGeek