marforic / imagemagick_lib_iphone

Scripts and instructions to compile ImageMagick as a static library to use in any iOS project
314 stars 71 forks source link

Unable to compile magick++ #21

Open APshenkin opened 7 years ago

APshenkin commented 7 years ago

On final stage

# join libMagick++
    joinlibs=$(check_for_archs $LIB_DIR/$LIBNAME_magickpp)
    if [ $joinlibs == "OK" ]; then
        echo "[|- COMBINE $ARCHS]"
        accumul=""
        for i in $ARCHS; do
            accumul="$accumul -arch $i $LIB_DIR/$LIBNAME_magickpp.$i"
        done
        # combine the static libraries
        try lipo $accumul -create -output $LIB_DIR/libMagick++.a
        echo "[+ DONE]"
    fi

get this error

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: specifed architecture type (i386) for file (/Users/a.pshenkin/git/experimental/imagemagick_lib_iphone/target/im_libs/libMagick++-6.Q8.a.i386) does not match its cputype (16777223) and cpusubtype (3) (should be cputype (7) and cpusubtype (3))

Can you please help me to solve this issue? Have no idea how to solve it.

Here is my logfile https://drive.google.com/open?id=0B-9Ht-YXSa-BVzJvaC1BY19zUG8

BTW, if remove building for i386, everything is fine

APshenkin commented 7 years ago

Fix this issue by setting additional flag -arch ${BUILDINGFOR} in CPPFLAGS and LDFLAGS