LoginSignup
1
1

More than 3 years have passed since last update.

【Xcode9】 ld: file too small (length=0) file エラーでハマった

Last updated at Posted at 2019-05-16

環境

macOS High Sierra 10.13.6
Swift 3.1
XCode 9.4.1

症状

ソースは間違っていない(gitで管理しており他の人は問題なく動いていた)にも関わらずビルド時に下記のエラーが発生。

error_log
ld: file too small (length=0) file 'xxxxxxxxxxxxxxxxxxxx' for architecture xxxx
clang: error: linker command failed with exit code 1 (use -v to see invocation)

結論

Cleanしたら直った。

やり方

[メニュー] -> [Product] -> [Clean]

もしくは

Cmd + Shift + K

参考

備忘録

参考の記事にも書いてありますが「エラー発生→実装は間違っていない→とりあえずクリーン」これは覚えておいた方が良さそう。

まだswift歴1ヶ月ですが、こんなエラーに4時間以上持ってかれた。。。
同じ初心者仲間で同じ泥沼にハマらないようにメモも兼ねての投稿。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1