【发布时间】:2023-03-27 19:35:01
【问题描述】:
我在 Xcode 中有 C++ 项目
我想在其中使用 C 库 aws4c https://code.google.com/p/aws4c/
这是我的 apn.cpp 文件:
#include "aws4c.h"
...
int main(int argc, char *argv[])
{
aws_init();
...
}
在 Xcode 中看起来不错,但是当我尝试构建时 - 出现错误
Undefined symbols for architecture x86_64:
"aws_init()", referenced from:
_main in apn.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
在 Xcode5 中将 C 库链接到 C++ 项目的正确方法是什么?
【问题讨论】: