c++ - make[1] Error 1 when building Library -
i use following script build c++ library. i386 architecture works fine, arm64 error message.
the error:
make[1]: *** [base/low/cl_low_div.lo] error 1 make: *** [install-recursive] error 1
the script :
#!/bin/bash platformpath="/applications/xcode.app/contents/developer/platforms" toolspath="/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin" export iphoneos_deployment_target="10.1" pwd=`pwd` findlatestsdkversion() { sdks=`ls $platformpath/$1.platform/developer/sdks` arr=() sdk in $sdks arr[${#arr[@]}]=$sdk done # last item current sdk, since alpha ordered count=${#arr[@]} if [ $count -gt 0 ]; sdk=${arr[$count-1]:${#1}} num=`expr ${#sdk}-4` sdkversion=${sdk:0:$num} else sdkversion="10.1" fi } buildit() { target=$1 hosttarget=$1 platform=$2 if [[ $hosttarget == "x86_64" ]]; hostarget="i386" elif [[ $hosttarget == "arm64" ]]; hosttarget="arm" fi export cc="$(xcrun -sdk iphoneos -find clang)" export cpp="$cc -e" export cflags="-arch ${target} -isysroot $platformpath/$platform.platform/developer/sdks/$platform$sdkversion.sdk -miphoneos-version-min=$sdkversion" export ar=$(xcrun -sdk iphoneos -find ar) export ranlib=$(xcrun -sdk iphoneos -find ranlib) export cppflags="-arch ${target} -isysroot $platformpath/$platform.platform/developer/sdks/$platform$sdkversion.sdk -miphoneos-version-min=$sdkversion" export ldflags="-arch ${target} -isysroot $platformpath/$platform.platform/developer/sdks/$platform$sdkversion.sdk" mkdir -p $pwd/output/$target ./configure --prefix="$pwd/output/$target" --disable-shared --disable-sqlite --host=$hosttarget-apple-darwin make clean make make install } findlatestsdkversion iphoneos buildit arm64 iphoneos lipo -create ./output/arm64/lib/libcln.a -output libcln.a
one of errors (all similar):
base/low/cl_low_div.cc:210:8: error: declaration of 'divu_64_rest' in global scope conflicts declaration c language linkage uint64 divu_64_rest; ^ ./base/cl_low.h:982:21: note: declared c language linkage here extern "c" uint64 divu_64_rest; // -> rest r
i not find information on connection between , architecture library being built for.
thanks in advance.
please post errors in question, not somewhere else, not someplace that doesn't allow plain text copy/paste. choose relevant parts of complete output , post only, not mass of useless content.
your problem in header file cl_low.h
declare variable this:
extern "c" uint64 divu_64_rest;
but in source file cl_low_div.cc
define as:
uint64 divu_64_rest;
those not same. must have extern "c"
(or not) identically both when declare variable , when define it. errors seem similar.
Comments
Post a Comment