Clang: error: linker command worked with exit code 1 - library not found
I have a problem building my project. I am getting below error for some reason from last week and cannot get rid of it.
Ld /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos/SmartPic.app/SmartPic normal armv7
cd "/Users/Nathan/Documents/Xcode Projects/SmartPic"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
-L/Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos
-F/Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos -filelist /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Intermediates/SmartPic.build/Debug-iphoneos/SmartPic.build/Objects-normal/armv7/SmartPic.LinkFileList -dead_strip -miphoneos-version-min=4.3 -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework EventKit -framework EventKitUI -framework MessageUI -lz -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -framework QuartzCore -framework AVFoundation -framework CoreMedia -framework CoreMotion -framework CoreVideo -framework AudioToolbox -lDMReader -o /Users/Nathan/Library/Developer/Xcode/DerivedData/SmartPic-elnbgmemojraijcotdlcskagbibq/Build/Products/Debug-iphoneos/SmartPic.app/SmartPic
ld: library not found for -lDMReader
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I was looking for information on erorr as I had 6 other similar ones at some point and the answer was to remove the library search paths in build settings and get rid of all but this last one. Everything was fine until I imported some additional frameworks and classes. So not sure what exactly caused it and how I can fix it.
I'm still pretty new to app development, so please try not to be too technical.
Any help is greatly appreciated, thanks.
source to share
Solved this by changing the library search paths in build settings to
./Classes "$ (SRCROOT) / Classes"
Just in case someone will find it and want to try it.
EDIT: Just to add, I had the same problem again. And the reason it happened for me is because I changed the name of the folder which is in the .xcodeproj file. So in a folder on my mac, I had a directory called App Name
and a file called App Name.xcodeproj
. I changed the app name of the app to something else and despite updating build settings in xcode still had the same problem. I had to
- Right click
App Name.xcodeproj
- Click
Show Package Contents
- Open
project.pbxproj
- Then cmd + f (search) and enter
App Name
, I think there were only two places and they were 1/3 way down the page calledname
and immediately belowpath
. Change them to the new directory name, save and rerun the project and you should be fine.
source to share