Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7 - How to remove ld: warning: -read_only_relocs cannot be used with x86_64

I have recently updated to Xcode 7 and now receive the following warning when I compile:

ld: warning: -read_only_relocs cannot be used with x86_64

I don't think I changed anything in the build settings or code to create this. Does anyone know what is causing this warning and how to remove it?

like image 921
Reefwing Avatar asked Sep 29 '15 22:09

Reefwing


People also ask

How do I fix undefined symbol in XCode?

The error Undefined symbols for architecture arm64: "_OBJC_CLASS_$_SKAdImpression" during the iOS build usually happens if XCode or CocoaPods version is lower than required. To fix it update XCode to 12.5 or higher and CocoaPods to 1.10. 0 or higher.

How do I change my build settings in XCode?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.

Where is library search paths in XCode?

In the right pane, click the Build Settings tab, then scroll down to the Search Paths section, then enter the location of the iPhone simulator libraries in the Header Search Paths and Library Search Paths fields. $SRCROOT is a macro that expands to the directory where the Xcode project file resides.

Is IOS simulator arm64?

Both ios-arm64-simulator and ios-x86_64-simulator represent two equivalent library definitions. Seeing these when trying to create an xcframework for Apple Silicon that supports Mac Catalyst and the iOS Simulator: Both ios-arm64-simulator and ios-x86_64-simulator represent two equivalent library definitions.


1 Answers

I have found the problem for those interested. As mentioned in the comment, I'm using the Twilio API and if you install this via cocoapods it adds the -read_only_relocs flag to the Other Linker Flags in Xcode (found under Build Settings). Not only does this generate the warning above (on the simulator) but it wont compile on an actual device because you can't have both BITCODE = YES and this flag. If you want to compile, you will need to set Enable Bitcode to No in the Build Options.

like image 56
Reefwing Avatar answered Oct 13 '22 13:10

Reefwing