问题
I am using ImageMagick in an iOS project, however the library is outdated because the previous developer used the source code for this. I am using Xcode 6.3.2 and I want to use Cocoapods to integrate ImageMagick in the project instead of copying the source files. However when I integrate ImageMagick with Cocoapods I get four compiler warnings.
This is the content of my pods file:
target 'MyProject' do
pod 'ImageMagick', '6.8.8-9'
end
These are the 4 warnings:

If I try to change the file I get this warning popup

And I can't unlock the file, I get this other error

I am not that familiar with ImageMagick.
Are these warnings important? Should I change the .h file and configure it properly? How can I unlock this file? Any ideas on what I should configure to eliminate these warnings?
Is this the way to go? It doesn't feel right to modify a file inside a Cocoapod.
回答1:
In CocoaPods there is already compiled version of ImageMagick. So you need to define these macros only for your target to hide the warnings. As I understood, they won't change anything in ImageMagick, because it was already compiled.
So, open Preprocessor Macros
settings for your target or if you have several targets, for your whole project:

And add 2 variables for both "Debug" and "Release":
MAGICKCORE_HDRI_ENABLE=0
MAGICKCORE_QUANTUM_DEPTH=16

回答2:
You should set MAGICKCORE_QUANTUM_DEPTH
to 0, 16, 32, or 64 in a preprocessor macro.
You should also set MAGICKCORE_HDRI_ENABLE
to YES
or NO
To do that, you can either change your preprocessor macros to have those values, or you can use a post-install hook from CocoaPods to set those for you every time you run pod install
.
来源:https://stackoverflow.com/questions/30557967/ios-imagemagick-compiler-warnings-in-xcode