"curl_rule_01 declared as an array with negative size" error on built xcode 5 iOs7

10,252

Be careful: you must NOT change these macros inside curlbuild.h! This header is generated at configure time and it records (among other things) which architecture is targeted.

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

$ 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. Please refer to BBHTTP Dependencies for more details regarding how this static library has been compiled.

If you build an iOS app with iOS 7 as deployment target you certainly have the default archs configured within your build settings. And these defaults include a 32-bit slice, plus a 64-bit slice:

enter image description here

So in such a case you must include a libcurl fat static library that also contains a 64-bit slice (a.k.a arm64).

The curl iOS build scripts from BBHTTP's author might help you. Otherwise please refer to Nick Zitzmann libcurl pre-built.

Share:
10,252
Yedy
Author by

Yedy

I am a fan of clean coding.

Updated on June 04, 2022

Comments

  • Yedy
    Yedy almost 2 years

    I am trying to archive an iOS 7 App that is using BBHTTP-library which includes libCurl. The built-error:

    curl_rule_01 declared as an array with negative size
    

    The code-line in curlrules.h with the error:

    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
    

    I've tried it with these changes in curlbuild.h

    #define CURL_SIZEOF_LONG 4
    

    to

    #define CURL_SIZEOF_LONG 8`
    

    due to 64 bit, but it didn't change anything.