Undefined symbols for architecture armv7錯(cuò)誤匯總

Undefined symbols for architecture armv7

類似如此的問題:


Undefined symbols for architecture armv7:

"_deflateEnd", referenced from -[ASIDataCompressor closeStream] in ASIDataCompressor.o

"_OBJC_CLASS_$_ASIDataDecompressor", referenced from objc-class-ref in ASIHTTPRequest.o

"_deflate", referenced from: -[ASIDataCompressor compressBytes:length:error:shouldFinish:] in ASIDataCompressor.o

"_deflateInit2_", referenced from: -[ASIDataCompressor setupStream] in ASIDataCompressor.o

ld: symbol(s) not found for architecture armv7

collect2: ld returned 1 exit status

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

解決方案:

Common Causes

The common causes for "Undefined symbols for architecture armv7" are:

  1. You import a header and do not link against the correct library. This is common, especially for headers for libraries like QuartzCore since it is not included in projects by default. To resolve:
  • Add the correct libraries in the Link Binary With Libraries section of the Build Phases.

  • If you want to add a library outside of the default search path you can include the path in the Library Search Paths value in the Build Settings and add

-l{library_name_without_lib_and_suffix} (eg. for libz.a use -lz)to the Other Linker Flags section of Build Settings.

  1. You copy files into your project but forgot to check the target to add the files to. To resolve:
  • Open the Build Phases for the correct target, expand Compile Sources and add the missing .m files. If this is your issue please upvote Cortex's answer below as well.
  1. You include a static library that is built for another architecture like i386, the simulator on your host machine. To resolve:
  • If you have multiple library files from your libraries vendor to include in the project you need to include the one for the simulator (i386) and the one for the device (armv7 for example).

  • Optionally, you could create a fat static library that contains both architectures.

From:Stackoverflow link

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末烈和,一起剝皮案震驚了整個(gè)濱河市拇舀,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌躁锡,老刑警劉巖掠归,帶你破解...
    沈念sama閱讀 216,591評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件撇簿,死亡現(xiàn)場(chǎng)離奇詭異屑宠,居然都是意外死亡困檩,警方通過查閱死者的電腦和手機(jī)腰埂,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,448評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門飒焦,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人屿笼,你說我怎么就攤上這事牺荠。” “怎么了驴一?”我有些...
    開封第一講書人閱讀 162,823評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵休雌,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我肝断,道長(zhǎng)杈曲,這世上最難降的妖魔是什么驰凛? 我笑而不...
    開封第一講書人閱讀 58,204評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮担扑,結(jié)果婚禮上恰响,老公的妹妹穿的比我還像新娘。我一直安慰自己涌献,他們只是感情好胚宦,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,228評(píng)論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著燕垃,像睡著了一般间唉。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上利术,一...
    開封第一講書人閱讀 51,190評(píng)論 1 299
  • 那天呈野,我揣著相機(jī)與錄音,去河邊找鬼印叁。 笑死被冒,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的轮蜕。 我是一名探鬼主播昨悼,決...
    沈念sama閱讀 40,078評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼跃洛!你這毒婦竟也來了率触?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,923評(píng)論 0 274
  • 序言:老撾萬榮一對(duì)情侶失蹤汇竭,失蹤者是張志新(化名)和其女友劉穎葱蝗,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體细燎,經(jīng)...
    沈念sama閱讀 45,334評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡两曼,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,550評(píng)論 2 333
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了玻驻。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片悼凑。...
    茶點(diǎn)故事閱讀 39,727評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖璧瞬,靈堂內(nèi)的尸體忽然破棺而出户辫,到底是詐尸還是另有隱情,我是刑警寧澤嗤锉,帶...
    沈念sama閱讀 35,428評(píng)論 5 343
  • 正文 年R本政府宣布渔欢,位于F島的核電站,受9級(jí)特大地震影響档冬,放射性物質(zhì)發(fā)生泄漏膘茎。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,022評(píng)論 3 326
  • 文/蒙蒙 一酷誓、第九天 我趴在偏房一處隱蔽的房頂上張望披坏。 院中可真熱鬧,春花似錦盐数、人聲如沸棒拂。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,672評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽帚屉。三九已至,卻和暖如春漾峡,著一層夾襖步出監(jiān)牢的瞬間攻旦,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,826評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工生逸, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留牢屋,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,734評(píng)論 2 368
  • 正文 我出身青樓槽袄,卻偏偏與公主長(zhǎng)得像烙无,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子遍尺,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,619評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容