xcodebuild failure clang:error no such file or directory:

Todd McGuinness picture Todd McGuinness · Feb 19, 2013 · Viewed 34.9k times · Source

Having a problem when building with xcodebuild. My project/app builds fine with the Xcode - gui. It simply isn't finding/building the libcryptopp library which is part of the build process.

The error is:

clang: error: no such file or directory: '/Users/builder/repo/ioskpay/xcode-cryptopp/cryptopp/build/Release-iphoneos/libcryptopp.a'  

This particular file should be derived from another project inside the main app - xcodebuild simply isn't correctly pointing at the right file folder which should be:

~/Library/Developer/Xcode/DerivedData

Any ideas?

Answer

Ken Van Hoeylandt picture Ken Van Hoeylandt · Apr 10, 2013

To fix this, go to your project settings, go to Targets and select your main project target. Then go to Build phases. Under Target dependencies add the static library project.

This way, when you compile the main project, the static library subproject gets compiled before the main project and your static library will be available.