"curl_rule_01 is declared as an array with a negative size" error on the built-in xcode 5 iOs7

I am trying to archive an iOS 7 application that uses the BBHTTP library that includes libCurl. Built-in error:

curl_rule_01 declared as an array with negative size 

The line code in curlrules.h with an error:

 [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; 

I tried this with these changes in curlbuild.h

 #define CURL_SIZEOF_LONG 4 

to

 #define CURL_SIZEOF_LONG 8` 

due to 64 bits, but nothing has changed.

+6
source share
1 answer

Be careful: you should not modify these macros inside curlbuild.h ! This header is generated during setup, and it records (among other things) what architecture it is targeting.

If you look at the pre-built static library provided by BBHTTP, you will see that it only targets the ARMv7 and ARMv7s :

 $ otool -fV External/libcurl.iOS/libcurl.iOS.appstore.a | grep Archive Archive : External/libcurl.iOS/libcurl.iOS.appstore.a (architecture armv7) Archive : External/libcurl.iOS/libcurl.iOS.appstore.a (architecture armv7s) 

These are 32-bit architectures. For more information on how this static library is compiled, see BBHTTP Dependencies .

If you are building an iOS application with iOS 7 as your deployment target, you probably have the default arches configured in your build settings. And these defaults include a 32-bit fragment, plus a 64-bit fragment:

enter image description here

So, in that case, you should include libcurl fat static library , which also contains a 64-bit slice (aka arm64 ).

BBLTTP curl iOS build scripts can help you. Otherwise, see Nick Zitzmann libcurl, pre-built .

+7
source

Source: https://habr.com/ru/post/958764/


All Articles