curl-library
Problem compiling latest CVS in MSVC
Date: Sun, 22 Feb 2004 18:20:51 -0500
When I attempt to compile using MSVC, I an error whenever SIZEOF_CURL_OFF_T
is referenced. The problem seems to be that the config-win32.h (nor the
config-mac.h, config-riscos.h, config-vms.h if they matter) have
SIZEOF_CURL_OFF_T defined like config.h.in does in Linux.
Since you use __int64 in MSVC, I guess the proper solution is to add:
#define SIZEOF_CURL_OFF_T 8
to config-win32.h
Then, the MSVC project files in lib/ are outdated (I'd fix them myself but I
use MSVC 7.0 which uses a different format for the files) It still mentions
getpass.c, which is no longer used by the library.
Next, the curlx_strtoll stuff. MSVC doesn't need this. Indeed, it does not
have strtoll, but this is Microsoft! They have the feature, just with a
nonstandard function name. MSVC has _strtoi64 for signed, and _strtoui64 for
unsigned 64bit integers. So basically with MSVC, strtoofft should point to
_strtoi64. The way it is currently setup makes it use curlx_strtoll, which
the file for was never added to the MSVC project files so it results in an
undefined symbol.
Basically adding an #ifdef for _MSC_VER to strtoofft.h to make it go to
_strtoi64 solved this problem.
Once I made all the above mentioned changes, libcurl successfully compiles
with MSVC. I would have included a patch for all of this, but I don't know
much about the off_t stuff, so I don't know if what I said is truly correct.
Dominick Meglio
Received on 2004-02-23