development

아키텍처 arm64에 대한 정의되지 않은 기호

big-blog 2020. 5. 14. 20:33
반응형

아키텍처 arm64에 대한 정의되지 않은 기호


CocoaPods에서 파일을 가져올 때마다 Apple Mach-O Linker 오류가 발생합니다.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FBSession", referenced from: someFile
ld: symbol(s) not found for architecture arm64

내가 사용하는 다양한 포드에 대해이 중 약 12 ​​개를 얻습니다.

XCode 5를 사용하여 iPhone 5S를 빌드하려고합니다.

나는 여기에서 다양한 솔루션을 시도했지만 아직 작동 할 솔루션이 없습니다.

이 Apple Mach-O Linker 오류를 어떻게 해결합니까?


흥미로운 또 다른 경고를 찾았습니다. 이것이 해결책으로 이어지기를 바랍니다.

Ignoring file ~/Library/Developer/Xcode/DerivedData/SomeApp/Build/Products/Debug-iphoneos/libPods.a, 

file was built for archive which is not the architecture being linked (arm64):~/Library/Developer/Xcode/DerivedData/someApp/Build/Products/Debug-iphoneos/libPods.a


아키텍처유효한 아키텍처 가 모두 올바른 경우 다음 과 같이 $(inherited)포드에서 생성 된 링커 플래그를 다른 링커 플래그 에 추가하는 추가 여부를 확인할 수 있습니다.여기에 이미지 설명을 입력하십시오


문제는 cocoapod가 arm64 아키텍처 용으로 빌드되지 않았으므로 빌드 할 때 링크 될 수 없다는 것입니다. 패키지를 업데이트하고 해당 아키텍처를 사용할 때까지 해당 패키지를 사용할 수 없습니다. 프로젝트-> 대상 (프로젝트 이름)-> 빌드 설정으로 이동하여 아키텍처를 표준 아키텍처 (armv7, armv7s)로 변경하고 유효한 아키텍처를 armv7, armv7s로 변경하여 링커 오류를 해결할 수 있습니다.

그러나 이는 64 비트 프로세서의 성능을 최대한 활용할 수 없다는 것을 의미합니다. 당신은 당신이 5 대를 위해 건설하고 있다고 말했기 때문에 이것이 필요한 이유가있을 수 있습니다. 어떤 이유로 든 그 힘이 절대적으로 필요하고 (아마 게임을 만들고있을 때) 필사적으로 해당 파일이 필요한 경우 풀 요청을 제출 한 다음 풀 필드에서 동일한 필드를 arm64로 설정하여 arm64로 프로젝트를 다시 컴파일 할 수 있습니다 오픈 소스 프로젝트. 그러나 이러한 파일이 64 비트 호환 가능해야하지 않으면 현재로서는 약간의 잔인한 것처럼 보입니다.

편집 : 일부 사람들은 또한이 문제를 해결하기 위해 Build For Active Architectures를 YES로 설정해야한다고보고했습니다.

2014-04-28 현재 설정은 다음과 같습니다.

여기에 이미지 설명을 입력하십시오


나는 다음을 설정 하여이 문제를 해결했다.

ARCHS = armv7 armv7s

VALID_ARCHS = armv6 armv7 armv7s arm64


구현 AVPictureInPictureController동일 / 유사한 문제 가 발생하여 프로젝트에서 AVKit 프레임 워크를 연결하지 않았다는 것이 문제였습니다 .

오류 메시지는 다음과 같습니다.

Undefined symbols for architecture armv7:
   "_OBJC_CLASS_$_AVPictureInPictureController", referenced from:
       objc-class-ref in yourTarget.a(yourObject.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

해결책:

  1. 프로젝트로 이동
  2. 대상을 선택하십시오
  3. 그런 다음 빌드 단계 로 이동 하십시오.
  4. 라이브러리가있는 오픈 링크 바이너리
  5. 마지막으로, 단지 추가 + AVKit의 프레임 워크 / 다른 프레임 워크를 .

바라건대 이것은 다른 사람이 비슷한 문제를 겪을 수 있기를 바랍니다.


나는 또한 같은 문제가 발생, 위의 방법은 작동하지 않습니다. 실수로 다음 디렉토리의 파일을 삭제했습니다.

폴더 배치 :

~ / 라이브러리 / 개발자 / Xcode / DerivedData /

여기에 이미지 설명을 입력하십시오


설정 아키텍처하는 ARMv7 armv7s , 활성 아키텍처 구축NO를 포함하여 프로젝트의 모든 대상에 대해, 모든 일 에서 포드


오른쪽의 대상 멤버 자격에서 선택한 구현 파일을 확인하여 수정했습니다. 이것은 확장 기능, 즉 사용자 정의 키보드를 다룰 때 특히 유용합니다.

대상 회원


build_active_architecture가 NO로 설정된 이유에 대한 설명. Xcode는 이제 어떤 장치를 연결했는지 감지하고 이에 따라 활성 아키텍처를 설정합니다. 따라서 2 세대 iPod Touch를 컴퓨터에 연결하면 Xcode는 활성 아키텍처를 armv6으로 설정해야합니다. 위의 디버그 구성으로 대상을 빌드하면 armv6 바이너리 만 빌드하여 시간을 절약 할 수 있습니다 (큰 프로젝트가 아닌 한 차이를 느끼지 않지만 시간이 지남에 따라 초가 추가되는 것 같습니다).

App Store에 게시하기 위해 배포 구성을 생성 할 때이 옵션이 설정되어 있지 않은지 확인해야합니다. http://useyourloaf.com/blog/2010/04/21/xcode-build-active -architecture-only.html


DerivedData-> Build-> Products-> Debug-iphoneos의 내용을 삭제 한 후 해결되었습니다.


Valid Architecture 에서 arm64제거 하고 NOActive Architecture Only로 설정 하면 됩니다. 이제 청소하고 빌드하고 실행하십시오. 이 오류는 다시 표시되지 않습니다.

:) KP


이 관련이있을 수도 libz.dylib또는 libz.tbd바로 연결 바이너리에 대한 귀하의 목표에 추가하고 다시 컴파일 할 필요가.


릴리스에서 유효한 아치를 armv7 armv7s로 설정하고 빌드 활성 아키텍처 만 YES로 설정 한 다음 명령 줄에서 새로운 "포드 설치"를 수행하여 문제를 해결했습니다.


iPhone 5s에서 64 비트 버전의 타사 라이브러리를 아직받지 못했기 때문에 최신 Xcode를 사용하여 32 비트 모드로 돌아 가야했습니다 (5.1 이전에는 불평하지 않았습니다).

유효한 아키텍처 목록에서 arm64를 삭제 한 다음 빌드 활성 아키텍처 만 NO로 설정하여이 문제를 해결했습니다. 위와 같이 다른 방법보다 더 의미가있는 것 같습니다. 다른 사람들이 위의 솔루션 중 어느 것도 효과가없는 경우에 게시하고 있습니다.


Xcode 5.1로 업그레이드 한 후 동일한 문제가 발생했으며 아키텍처armv7 armv7s 로 설정하여 수정했습니다.


하루 종일이 문제에 갇혀있었습니다.

여러 구성표가 있었고 데모, 내부, 릴리스에 적합하게 컴파일되었지만 디버그 구성표는 컴파일되지 않고 libPods.a에 대해 불평했습니다.

해결책은 프로젝트-> 대상-> 빌드 설정으로 이동하여 "Build Active Architecture Only"를 YES로 변경하는 것입니다. 깨끗하고 빌드! 마침내 머리 가려움증이 해결되었습니다!


설정 -ObjCOther Linker Flags대상의 빌드 설정에 문제를 해결했다.


이것은 나를 위해 일했다 :

ios SDK 9.3

app.xcodeproj 유효한 아키텍처 의 빌드 설정으로 : armv7 armv7s 활성 아키텍처 빌드 : 아니오

깨끗하고 빌드하고 나를 위해 일했습니다.


다음 은 유효한 아키텍처 목록에서 arm64를 제거 할 필요 없이 64 비트 시뮬레이터와 레티 나 iPad 미니 모두 Xcode 5.1에서 오류없이 GPUImage를 컴파일 하는 데 도움이되었습니다 (테스트를 위해 64 비트 장치를 소유하는 목적을 상실 함) 64 비트 성능).

GitHub 페이지에서 .zip 폴더를 다운로드하십시오. https://github.com/BradLarson/GPUImage

압축을 풀고 'framework'폴더로 이동하십시오. 여기에서 'Source'폴더를 Xcode 프로젝트에 추가하고 복사하십시오. '대상 그룹의 폴더에 항목 복사'가 선택되어 있고 '추가 된 폴더에 대한 그룹 작성'도 선택되어 있는지 확인하십시오. 일반, iOS 및 Mac 헤더 / 구현 파일이 프로젝트에 복사됩니다.

iOS 용으로 컴파일하기 때문에 Mac 파일이 필요하지 않은 경우 파일을 프로젝트로 복사하기 전에 또는 Xcode 내에서 그룹을 간단히 삭제하기 전에 Mac 폴더를 삭제할 수 있습니다.

소스 폴더를 프로젝트에 추가하면 다음을 사용하여 GPUImage의 클래스 / 메서드 사용을 시작하십시오.

#import "Source/GPUImage.h" 

몇 가지 지적 할 사항 :

  • If you get an error saying 'Cocoa' not found, you've added the Mac folder/headers into your iOS project - simply delete the Mac group/files from your project and the warning will vanish
  • If you rename the Source folder (not the group in Xcode), use that name instead of "Source/GPUImage.h" in the #import instruction. So if you rename the folder to GPUImageFiles before you add to your project, use: #import "GPUImageFiles/GPUImage.h
  • Obviously ensure arm64 is selected in the Valid Architectures list to take advantage of the A7 64-bit processor!
  • This isn't a GPUImage.framework bundle (such as if you downloaded the framework from http://www.raywenderlich.com/60968/ios-7-blur-effects-gpuimage) so it may not the correct way to use GPUImage that Brad Larson intended, but it works for my current SpriteKit project.
  • There's no need to link to frameworks/libraries etc - just import the header and implementation source folder as described above

Hope the above helps - it seems there were no clear instructions anywhere despite the question being asked multiple times, but fear not, GPUImage definitely works for arm64 architecture!


This issue occurred for me after installing a pod via Podfile and pod install. After trying a bunch of different fixes I finally just imported the Pod manually (dragging the necessary files into my project) and that solved the problem.


As morisunshine answer pointed in right direction, a little tweak in his answer solved my problem for iOS8.2 .Thanks to him.

I solved this problem by setting that:

ARCHS = armv7

VALID_ARCHS = armv6 armv7 armv7s arm64

BUILD ACTIVE ARCHITECTURE ONLY= NO

  1. Go to target Build Settings.
  2. set BUILD ACTIVE ARCHITECTURE ONLY = NO for both Debug and Release
  3. Build and run

In my case, I had to look for

C++ Standard Library and make sure that the libc++ was the one selected.


For me, I use opencv 2.4.9 in xcode 7.2 for iOS and the errors above occurred, and I solve the errors by using the opencv through pod install rather than offline opencv framework.

You can have a try by adding the opencv pod text below and delete the offline opencv framework if you have used.

pod 'OpenCV', '2.4.9'


None of the solutions fix this error in my case(Xcode 9), with TesseractOCRiOS. After hours of trial and error, I came up with a good solution. I just delete 'pod 'TesseractOCRiOS', '~> 4.0.0' in the Podfile, run pod install. And then, add pod 'TesseractOCRiOS', '~> 4.0.0' back to Podfile and run pod install again.

Bang! It works!


in some case, if you define one more interface in a .h file, but did not implementation all these interface, this error occurred.

The linker can't found the implementation in .m file, so you need to implementation it in your .m file for every interface.

To resolve this error:

1.in .m file, supply the implementation for each interface. 2.rebuild


I have facing the same problem after installing the AWS framework to overcome this issue,I have update the POD config file from your project which get created after installing AWS POD. Check config file as below

OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-AWSAutoScaling" -l"
Pods-   AWSCloudWatch" -l"Pods-AWSCognito" -l"Pods-AWSCore" -l
"Pods-AWSDynamoDB" -l"Pods-AWSEC2" -l"Pods-AWSElasticLoadBalancing" 
-l"Pods-AWSKinesis" -l"Pods-AWSLambda" -l"Pods-AWSMachineLearning" 
-l"Pods-AWSS3" -l"Pods-AWSSES" -l"Pods-AWSSNS" -l"
Pods-AWSSQS"-l "Pods-AWSSimpleDB" -l"Pods-Bolts" -l"Pods-FMDB" 
-l"Pods-GZIP" -l"Pods-Mantle" -l"Pods-Reachability" -l"Pods-TMCache" 
-l"Pods-UICKeyChainStore" -l"Pods-XMLDictionary" -l"sqlite3" -l
"z"-framework "Accelerate" -framework "AssetsLibrary" 
-framework "CoreLocation" -framework "Foundation" -framework
"ImageIO" -framework "Security" -framework "SystemConfiguration"
-framework "UIKit" -weak_framework "UIKit"
 OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)   

if your config file not working properly then Set your Other Linker flag to $(inherited)


If the architecture and linker settings look good, check your h files. My issue was the same error, but I had restructured the h files and I removed an extern statement. Other m files were using that variable, causing the linker error.


Adding "Security.framework" did the trick for me.


I know this is an old branch. However, the same problem started happening to me after migrating to the latest CocoaPods version (1.0.0) and trying to reinstall all pods. I encountered the "Missing symbols for armv64" linker error. Oddly enough, I solved it by performing the following steps:

  1. Remove all pods (pod init, pod install)

  2. Rewrite the podfile in a reversed order (instead of: pod "Mixpanel", pod "Intercom", I used: pod "Intercom", pod "Mixpanel" )

  3. Pod install

Reversing the order of the dependencies in the podfile and rebuilding the pods has solved the problem.


"The OPN [Debug] target overrides the OTHER_LDFLAGS build setting". This was the main issue. After adding $(inherited) in new line in other linker flags solved my issue. 여기에 이미지 설명을 입력하십시오

참고 URL : https://stackoverflow.com/questions/19213782/undefined-symbols-for-architecture-arm64

반응형