同时使用C文件和Cocoa类时出现问题
我已经将ffmpeg和SDL库导入到我的Xcode项目中,用于Cocoa应用程序。 当我的项目仅包含Cocoa类时,我的项目使用这些库成功构建和运行,但当我在项目中包含C文件时,构建失败,出现一个警告和35个错误: 警告是:同时使用C文件和Cocoa类时出现问题,c,cocoa,ffmpeg,warnings,C,Cocoa,Ffmpeg,Warnings,我已经将ffmpeg和SDL库导入到我的Xcode项目中,用于Cocoa应用程序。 当我的项目仅包含Cocoa类时,我的项目使用这些库成功构建和运行,但当我在项目中包含C文件时,构建失败,出现一个警告和35个错误: 警告是: ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/libgcc.a, file was built for unsupported file for
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/libgcc.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
以及错误:
"___gedf2", referenced from:
_eval_expr in libavcodec.a(eval.o)
_quantize_lpc_coefs in libavcodec.a(lpc.o)
_rc_2pass2_before in libxvidcore.a(plugin_2pass2.o)
"___ledf2", referenced from:
_qp2bits in libavcodec.a(ratecontrol.o)
_get_qscale in libavcodec.a(ratecontrol.o)
"___umodsi3", referenced from:
_vorbis_parse_setup_hdr_codebooks in libavcodec.a(vorbis_dec.o)
_vorbis_parse_setup_hdr_codebooks in libavcodec.a(vorbis_dec.o)
要运行代码,以下是配置设置:
- 主动体系结构:x86_64
- 项目设置中的体系结构:标准(32/64位通用)
- Mac OS X版本:10.6.3
- Xcode版本:3.2.3
如果有人知道我遗漏了什么,请帮助我。谢谢。仔细阅读错误消息(我的重点): ld:警告:在/Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/libgcc.a中,文件是为不受支持的文件格式生成的,而该文件格式不是所链接的体系结构(x86_64) 看起来你是在混合PowerPC和Intel库。您正在为x86_64进行编译,但正在为PowerPC选择一个
libgcc.a
那些带有所有前导下划线的符号可能应该来自
libgcc.a
,但您没有链接到libgcc.a
的x86_64版本,因此它们在运行中丢失,随后出现混乱。听起来您的xcode配置有点混乱。Thanx需要回复。你能告诉我如何链接libgcc.a的x86_64版本吗@iPhoneDev:我不知道如何告诉xcode做正确的事情。检查xcode和项目中的所有配置设置。因为,您已经在项目中导入了静态lib。这可能是您的项目无法找到Dylibs引用的原因。