Programming

“라이브러리를 찾을 수 없습니다”오류

procodes 2020. 7. 1. 22:08
반응형

“라이브러리를 찾을 수 없습니다”오류


앱에 admob를 넣은 후 오류가 발생했습니다. 어제 응용 프로그램은 잘 작동했지만 오늘은 더 이상 작동하지 않습니다 .. 오류는 다음과 같습니다.

ld: library not found for -lGoogleAdMobAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)

그것을 고치는 방법? 감사 !!


때로는 라이브러리의 참조를 제거하고 참조를 다시 추가하기 만합니다.

Google 모바일 광고 SDK 및 기타 라이브러리를 처음부터 다시 추가하는 것 외에도 라이브러리 검색 경로 를 확인하는 것이 좋습니다 . 대상을 복사하거나 복제하는 경우 Xcode는 "\"로 큰 따옴표를 이스케이프 처리해야한다고 결정합니다. 모든 \를 제거해야합니다.

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

경로에 여러 개의 '\'를 접두어로 붙여서 오류를 복제 할 수있었습니다.


비슷한 "라이브러리를 찾을 수 없음"문제가있었습니다. 그러나 실수로 .xcodeproj파일 대신 파일 을 사용했기 때문 .xcworkspace입니다.


당신의 목표를 선택, 이동 "Build Phases"에서 "Link Binary With Libraries"제거 ".a"해당 라이브러리의 파일. 청소하고 건설하십시오.


Cocoapod와 관련된 오류가 다음과 같은 경우 :

library not found for -lPod-...

기타 링커 플래그 를 확인 하여 제거해야합니다.

추가 정보 : Cocoapod를 사용하는 오래된 프로젝트가있는 경우. 그리고 최근에 use_frameworks 를 추가해야 했습니다! 당신의 podfile에. cocoapods는 다른 링커 플래그에 라이브러리를 더 이상 상속하지 않습니다. 따라서 use_frameworks를 사용하기 전에 추가 한 다른 링커 플래그에서 수동으로 제거해야 할 수도 있습니다.


제 경우에는 Xcode 7 에서 Xcode 9.1 에서도 작동했습니다.

ld: library not found for -ldAfnetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

설정 Build Active architecture OnlyYes

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


오류가 다음과 같은 경우

ld : -lpods 용 라이브러리를 찾을 수 없습니다

프로젝트의 프레임 워크 그룹에서 빨간색 파일 (예 : 누락 된 파일) 인 "libPods.a"파일이 생성되었습니다. 방금 해당 파일을 제거하고 모든 것이 잘되었습니다.

편집 : 다른 솔루션

비슷한 질문에 이미 답변 한 다른 솔루션은 이 링크에 있습니다.


작업 공간 대신 ​​프로젝트 파일을 열 경우에도 발생할 수 있습니다. 나는 이런 식으로 하루를 허비했다.


고토 빌드 단계가 -> 링크 바이너리와 라이브러리 이 라이브러리는 프로젝트 폴더에서 사용할 수 없습니다 때문에 제거 라이브러리는 오류를 표시하는


This happens if you're using cocoapods and don't use the .xcworkspace file instead of the default .xcodeproj file.


Late for the answer but here are the list of things which I tried.So it will be in one place if anyone wants to try to fix the issue.

  1. Valid architecture = armv7 armv7s
  2. Build Active Architecture only = NO
  3. Target -> Build Settings ->Other Linker Flags = $(inherited)
  4. Target -> Build Settings ->Library Search Path = $(inherited)
  5. Product Clean
  6. Pod Update in terminal

In my case there was a naming issue. My library was called ios-admob-mm-adapter.a, but Xcode expected, that the name should start with prefix lib. I've just renamed my lib to libios-admob-mm-adapter.a and fixed the issue.

I use Cocoapods, and it links libraries with Other linker flags option in build settings of my target. The flag looks like -l"ios-admob-mm-adapter"

Hope it helps someone else


Simply, GoogleAdMobAds.a is missing in project target. For me it was libAdIdAccessLibrary.a Please check attached screenshot

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


Easy solution. Here's how I'd fix the issue:

  1. Go to the directory platforms/ios
  2. Then, execute the command pod install

That's it. This should install the missing library.


It is compile time error for a Static Library that is cased by Static Linker

ld: library not found for -l<Library_name>

You can get the error Library not found for when you have not include a library path to the Library Search Paths

You're experiencing this issue because Static Linker(ld) can't find the location of the library, simply tell Xcode where they are by adding the right directory to the Library Search Paths in Xcode for linking.

Build Settings -> Search Paths -> Library Search Paths 

The source is here


I know this is a bit old, but I just hit a similar issue and running 'pod update' fixed this for me. My library error was with AFNetworking...

Just be careful doing pod update if you don't use explicit versions in your pod file.


This error is very weird.

I had this error with -ldAfnetworking and I only copy my project in other path and works.


I tried renaming my build configuration Release to Production, but apparently cocoa pods doesn't like it. I renamed it again to Release, and everything builds just fine.


@raurora's answer pointed me in the right direction. I was including libraries in my "watchkitapp Extension/lib" path. In this case, the Library Search Path needed to be escaped with a '\', but the linker didn't seem to understand this. To fix / work-around the issue, I moved my lib path up one level so it was no longer in a directory that contained a space in the name.


I just update the pod file 'pod update' and it start to work for me normally.


Running 'pod update' in my project fixed my problem with the 'library not found for -lSTPopup' error.

Remarking Trevor Panhorst's answer:

"Just be careful doing pod update if you don't use explicit versions in your pod file."


As for me this problem occurs because i installed Material Library for IOS. to solve this issue

1 : 대상 앱의 빌드 설정 으로 이동 하십시오 .

2 : 다른 링커 플래그 검색

3 : 다른 링커 플래그를 열고 오류에 언급 된 라이브러리를 확인하십시오.

4 : 해당 플래그를 제거하십시오.

5 : 청소 및 빌드.

문제가 해결되기를 바랍니다.


ld: library not found for -{LIBRARY_NAME}라이브러리 파일이 없기 때문에 발생 하는 경우

응용 프로그램 대상의 "빌드 단계"라이브러리 검색 경로 탭에서 라이브러리 경로를 확인하십시오.

라이브러리 파일 경로는 실제 경로를 따라야합니다. 예를 들어 프로젝트 루트에있는 파일이 경로를 다음과 같이 설정해야하는 경우 $(PROJECT_DIR)

참고 URL : https://stackoverflow.com/questions/24050012/error-library-not-found-for

반응형