我是iPhone开发的新手,目前我正在尝试将一些静态库添加到我的项目中,但我收到了"Symbol(s) not found“错误。
我已经在谷歌上搜索了这个问题,并尝试了不同的解决方案,但没有任何运气。这些库是在PC上编译的,而不是在Mac上编译的,所以我的问题是:
我需要在Mac上编译代码吗?我需要什么工具才能编译它们?
我已经包含了这个项目的头文件。我尝试链接的代码是用c编写的,并且是为ARM GCC 4.2编译的。
我得到以下错误代码:
ld警告:在/Users/<>/Playground/Collage/libbaseapi.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmclearshot.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/excodecs.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmautorama.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmexex.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmex.a,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmextcoder.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmfacewarp.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmfxplugin.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmimagefusion.a中,/Users/<>/Playground/Collage/fmimageenhance.a,文件不属于必需的体系结构ld警告:文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmjpegsqueeze.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmjpegtools.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmphotoart.a中,文件不属于必需的体系结构ld警告:在/Users/<>/Playground/Collage/fmsemc.a中,文件不属于必需的体系结构ld警告:文件不属于所需的体系结构% ld警告:在/Users/<>/Playground/Collage/fmspeedview.a中,文件不属于所需的体系结构
未定义的符号:"_caps_destroyBuffer",引用自:-CollageMainView drawRect: in CollageMainView.o ld:未找到符号collect2: ld返回1个退出状态"_caps_destroyBuffer",引用自:-CollageMainView drawRect: in CollageMainView.o ld:未找到符号collect2: ld返回1退出状态构建失败(1错误)
BR,安德烈亚斯
发布于 2009-09-08 08:25:49
您不能向iPhone应用程序添加自定义(编译)库。您应该始终将源代码包含在项目中。
发布于 2009-09-08 08:27:21
您需要将库的头文件添加到项目中,或者如果缺少框架,则将其添加到Xcode中的"frameworks“文件夹中。
https://stackoverflow.com/questions/1392687
复制相似问题