curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: SIZEOF_LONG undefined when cross-compiling for iOS

From: Daniel Stenberg via curl-library <>
Date: Fri, 17 May 2019 10:21:27 +0200 (CEST)

On Fri, 17 May 2019, Jonas Vautherin via curl-library wrote:

> I have been trying to cross-compile curl for iOS, using leetal's toolchain
> [1] (and another, similar one that has the same issue).
> When building for the "Xcode" cmake generator (cmake -G Xcode <...>), curl
> build successfully. But when building for the "Unix Makefiles" generator, I
> get an error saying that SIZEOF_LONG is undefined.

Seems lame. The curl cmake file has always checked that size since the first
day we had one. Although I don't know how good cmake is at doing that for

> I see that SIZEOF_LONG is defined in curl_config.h.cmake [2], but I don't
> really get where it comes from.

In cmake builds, here:

(and obviouly similarly by configure, but that's not the topic here)

> Should I set it somewhere manually?

You should at least set it somewhere. Exactly what the best way is for you to
set it, I leave to you.

> And if yes, it is always right to say that it should be "8" on 64-bits
> archs, and "4" on 32-bits archs (as described here [3])?

All 64 bit iOS targets will have it at 8 as far as I know, yes.

  / | Get the best commercial curl support there is - from me
                   | Private help, bug fixes, support, ports, new features
Received on 2019-05-17