1

I've inherited an iOS project and can't even get it to build. I keep getting the following error:

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

I've seen posts about the 'file not found' error but none pertaining to the '-ObjC' bit that looks like a switch.

Any ideas?

  • mention your problem in detail. what framework you are using or etc. because this type of error come with many causes. like framework missing or not set header properly etc. – Badal Shah Jun 10 '15 at 10:46
  • Sorry, I'm not sure how best to answer. The deployment target is iOS 6.1. The following frameworks are listed in 'General': SystemConfiguration, Security, CoreData, CoreGraphics, CoreLocation, MapKit, UIKit, Foundation, QuartzCore, MessageUI. The following are also listed but in red: libGMDatePicker.a (I think this is an internal one), libCascade.a, libBCTabBarController.a, libFlurry.a, libPods.a They're all required. – Ashley Bickerstaff Jun 10 '15 at 10:55

3 Answers3

2

-ObjC is a valid option to ld, however it's possible to confuse ld if some other option is broken. For example the -framework option requires an argument and if that argument (the name of the framework) is missing then that would cause the sort of error you are seeing.

ld ... -framework -ObjC

However I cannot tell you exactly where the error is without seeing the complete linker command line.

Droppy
  • 9,691
  • 1
  • 20
  • 27
0

Look through your build settings, both in Xcode and in xcconfig file.

I have seen people adding an option - ObjC to some build settings for no good reason at all, and the linker may interpret that as a request to link a file named ObjC or -ObjC.

gnasher729
  • 51,477
  • 5
  • 75
  • 98
0

Thanks everyone, I managed to sort it.

@Droppy pointed me in the right direction.

Before the -ObjC flag there was another called -force_all. I then stumbled across this answer which indicated that you only need the -ObjC flag. I removed -force_all and it started to work!

Community
  • 1
  • 1