2017-01-15 16 views
0

Xcode 8.2.1でアプリケーションを実行してテストしようとしていますが、このエラーが発生しています。私は周りを探索してきましたが、私の問題のために働く答えを見つけることができません。ここで何が原因だろうか?リンカーコマンドが終了コード1で失敗しました - 重複するシンボル

duplicate symbol _randomPositionY in: /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/ViewController.o /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/AppDelegate.o duplicate symbol _Y in: /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/ViewController.o /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/AppDelegate.o duplicate symbol _randomPositionX in: /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/ViewController.o /Users/tetadickens/Library/Developer/Xcode/DerivedData/Stealth_Crash-gbxbrdfgfsyxnkafhbmltuvxvsvz/Build/Intermediates/Stealth Crash.build/Debug-iphonesimulator/Stealth Crash.build/Objects-normal/x86_64/AppDelegate.o ld: 27 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

私はエディタ]> [検証設定]に行ってきました後に、この問題が開始EDIT

+1

[リンクコードコマンドで失敗したリンカーコマンド1:重複するシンボル]の重複の可能性があります(http://stackoverflow.com/questions/11727444/linker-command-failed-with-exit-code-1-duplicate-symbol) –

答えて

0

コンパイラが述べたように、コードにはrandomPositionYという複数の定義があります。関数をヘッダファイルに宣言しても関数は複数実装されていなくてもかまいません。結局のところ、関数が呼び出されたときにどの実装を実行するべきかコンパイラがどのように知ることができますか?

0

あなたのコードには、randomposition_y、randomposition_x、symbol_yなどの27の重複シンボルがあります。 これらの変数をappdelegateとviewcontrollerで使用しているというエラーを表示してください。これらの変数の名前を変更すると、エラーが解決されます。

関連する問題