cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: use libcurl source files directly rather than link with library

From: Tom Bishop, Wenlin Institute <tangmu_at_wenlin.com>
Date: Tue, 17 May 2011 16:56:01 -0400

On May 17, 2011, at 11:08 AM, Daniel Stenberg wrote:
>
> ...
> But please rewind back again and do the build similar to this instead:
>
> $ ./configure --disable-shared
> $ make
>
> There, then you can point your app to use this directory to include from and you can link directly with lib/.libs/libcurl.a

Thanks, I just gave that a try. (I might never have thought to look for the static library in a hidden folder!) The result I get by cleaning and trying to compile is, again, the following error message in Xcode:

/Users/tbishop/wenlin/c/../curl/include/curl/curlrules.h:143:0 /Users/tbishop/wenlin/c/../curl/include/curl/curlrules.h:143: error: size of array '__curl_rule_01__' is negative

The message shows that curlrules.h is the one in my project's folder (version 7.21.6). It appears that the error occurs during compilation, before there is any attempt to link with the library. I don't see any sign that I have "mixed headers from two different libcurl releases" (that's exactly what I tried to avoid by deleting the old folder containing the old version of curl.h, and using #include "..." rather than #include <...>).

The reason I suspect it might involve a 64-bit versus 32-bit conflict is that on Mac OS, compiling on the command line normally produces 64-bit code. It's necessary to add a compiler flag such as "-arch i386" to obtain 32-bit code. I suspect that "./configure" would therefore configure for 64-bit code unless such a flag is added. When I entered "make", the "gcc" commands did not include "-arch i386". Also, "./configure" prints:

checking size of long... 8

I then tried this:

set CFLAGS="-arch 386"
./configure --disable-shared

Now it prints:

checking size of long... (cached) 8

Can anyone tell me where this "cache" is, and how to clear it? Or is there another way to request a 32-bit library? Or am I wrong in believing that a 64-bit library can't be linked with a 32-bit application?

Thank you, Daniel, Jeremy, and Adam, for your help and patience!

Best wishes,

Tom

文林 Wenlin Institute, Inc. Software for Learning Chinese
E-mail: wenlin@wenlin.com Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-17