ld: warning: MobileCoreServices.framework/MobileCoreServices, missing required architecture i386 in

本文解决了一个常见的iOS开发问题,即在项目中加入MobileCoreServices框架后出现的链接错误。错误主要源于框架被无意中复制到项目目录中,导致编译时架构缺失。文章提供了检查并删除项目目录中不合适的框架文件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误信息:

ld: warning: in /Users/koupoo/koupoo/BoardEditor/MobileCoreServices.framework/MobileCoreServices, missing required architecture i386 in file

Undefined symbols:

  "_kUTTagClassMIMEType", referenced from:

      _kUTTagClassMIMEType$non_lazy_ptr in ASIHTTPRequest.o

     (maybe you meant: _kUTTagClassMIMEType$non_lazy_ptr)

  "_kUTTagClassFilenameExtension", referenced from:

      _kUTTagClassFilenameExtension$non_lazy_ptr in ASIHTTPRequest.o

     (maybe you meant: _kUTTagClassFilenameExtension$non_lazy_ptr)

  "_UTTypeCreatePreferredIdentifierForTag", referenced from:

      +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o

  "_UTTypeCopyPreferredTagWithClass", referenced from:

      +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o

ld: symbol(s) not found

collect2: ld returned 1 exit status


产生类似错误的原因和具体的解决办法:

This happens when you add a framework to your project and unintentionally copy the framework into your project directory.

The fix is to check your project directory (where you store your project on disk) for any iphone SDK *.Framework files and delete them.

Project will build fine afterwards.


cc -o ../../bin/lsqfit main.o lsqfit_ls.o block_init.o line.o -L../../lib -ldblock -ldutil /home/ubuntu/software/tcl/tcl8.5.11/lib/libtcl8.5.so -lm -lc /usr/bin/ld: main.o: in function `main': main.c:(.text+0x239): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x499): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x5e3): undefined reference to `blk_open_file' /usr/bin/ld: main.c:(.text+0x8f9): undefined reference to `blk_open_file' /usr/bin/ld: ../../lib/libdblock.a(skip.o): in function `blk__skip': skip.c:(.text+0xed): undefined reference to `blk__getlines' /usr/bin/ld: skip.c:(.text+0x126): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_init_read': read.c:(.text+0x15): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_blk': read.c:(.text+0x6a): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_data': read.c:(.text+0xad): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk__read_data': read.c:(.text+0x119): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x1b2): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x1e5): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_check': read.c:(.text+0x398): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_read_blk_check': read.c:(.text+0x3d6): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk__read_check': read.c:(.text+0x49b): undefined reference to `blk__getlines' /usr/bin/ld: read.c:(.text+0x788): undefined reference to `blk__getlines' /usr/bin/ld: ../../lib/libdblock.a(read.o): in function `blk_print_env': read.c:(.text+0xbdf): undefined reference to `blk__getenv' /usr/bin/ld: ../../lib/libdblock.a(variables.o
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值