2016-07-05 6 views
2

私は単純な数学関数を使ってスタティックライブラリを作成し、ユニバーサルバイナリを構築しました。これを構築する間、アクティブなアーキテクチャーのビルドのみがNOに設定されました。アーキテクチャarm64の未定義のシンボルxcode 7.3

lipo -info libcheckC.a 
Architectures in the fat file: libcheckC.a are: armv7 x86_64 arm64 

が、私は別のプロジェクトにこのファイルを追加し、 他のリンカーフラグが-ObjC、-lcheckC、$を持っていることを確認したライブラリがフェーズを構築する」の下にも存在している

を(継承) - >リンクライブラリとバイナリ "。

私はブリッジヘッダーを作成し、ヘッダーファイルをプロジェクトに追加しました。追加-vと深いそこから行くとのXcodeからコピー -

私はまだエラー

Undefined symbols for architecture arm64: 
"_squareOf", referenced from: 
     checkCLib.ViewController.calculate (__ObjC.UIButton) ->() in ViewController.o 
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

私は手動でコマンドを実行しようとすると私は、次の火、

のXcode 7.3を使用していますに取得しています。私は以下の詳細を得る。

@(#)PROGRAM:ld PROJECT:ld64-264.3.101 
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS) 
Library search paths: 
/Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/ 
/Users/test/Documents/MyIApps/checkCLib/checkCLib 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib 
Framework search paths: 
/Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/ 
/Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/ 
Undefined symbols for architecture arm64: 
    "_squareOf", referenced from: 
    checkCLib.ViewController.calculate (__ObjC.UIButton) ->() in ViewController.o 
ld: symbol(s) not found for architecture arm64 

ライブラリは、前述のパスに存在し、シンボルを含み、アーキテクチャもサポートします。

lipo -info /Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/libcheckC.a 
Architectures in the fat file: /Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/libcheckC.a are: armv7 x86_64 arm64 

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm /Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/libcheckC.a 

/Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal/libcheckC.a(square.o): 
0000000000000000 T _sqaureOf 

答えて

0

あなたはライブラリ検索パスにライブラリへのパスを追加しましたか?私の場合

enter image description here

+0

はい。ライブラリ検索パスには、 "$(継承)"、$(PROJECT_DIR)/ checkCLibが含まれています。また、/ Users/test/Library/Developer/Xcode/DerivedData/Build/Products/Release-universal /を – Amruta

+0

に追加しましたが、検索パスは大丈夫ですか? – tymac

+0

ライブラリが見つかりませんでした。それで、ライブラリではなくシンボルが見つかります。すばやいファイルに "include"/"import"ステートメントを追加する必要がありますか? – Amruta

0

、Iはまた.C(コード)ファイルだけでなく.H(ヘッダ)ファイルのinclude文を追加することにより問題を解決しました。 そうでない場合は、XCodeが関数を見つけることができなかったようです。

関連する問題