cURL / Mailing Lists / curl-library / Single Mail


Building for Win64...

From: Nick Zitzmann <>
Date: Sun, 19 Aug 2012 14:32:46 -0600

I tried searching around and didn't see anything relevant…

Yesterday I tried building the latest curl & libcurl code for Win64 (X86-64, not Itanium) mainly to see how Schannel worked. I performed the build using Visual Studio's command prompt configured for building Win64 executables. I ran into two things:

1. I kept getting linker errors about linking to 32-bit libraries until I noticed the undocumented MACHINE build setting, which had to be manually set to "x64" in order to get it to link. Was this done on purpose? If so, then this is probably a dumb question, but why was this done? Could this be documented somewhere? It seems to me it should inherit the build setting from the command line… (Of course, on OS X, the opposite is true: To build for 32-bit, one must manually set the CFLAGS and LDFLAGS environmental variables to include "-arch i386".)

2. I also got the following compiler warning:

..\lib\curl_schannel.c(693) : warning C4267: 'function' : conversion from 'size_t' to 'unsigned long', possible loss of data

It looks like the code is doing a 64-to-32-bit conversion, and on Win64, size_t is 64 bits wide, and I know Microsoft kept longs 32 bits wide in Win64. What's the best way to go about fixing this? I thought about just casting that warning out of existence, but then I thought that might cause other problems…

Nick Zitzmann

List admin:
Received on 2012-08-19