jmacd / xdelta

open-source binary diff, delta/differential compression tools, VCDIFF/RFC 3284 delta compression
http://xdelta.org
1.09k stars 181 forks source link

Visual Studio builds are broken. #258

Open plaska-verys opened 4 years ago

plaska-verys commented 4 years ago

When you try to build, using Visual Studio, with one of the following build configurations, Win32 | Release and x64 | Debug, Visual Studio provides the following errors:

1>C:\dev\github\xdelta\xdelta3\xdelta3.h(173,29): error C2065: 'SIZEOF_SIZE_T': undeclared identifier
1>C:\dev\github\xdelta\xdelta3\xdelta3.h(173,81): error C2057: expected constant expression
1>C:\dev\github\xdelta\xdelta3\xdelta3.h(179,41): error C2065: 'SIZEOF_UNSIGNED_LONG_LONG': undeclared identifier
1>C:\dev\github\xdelta\xdelta3\xdelta3.h(179,117): error C2057: expected constant expression
1>C:\dev\github\xdelta\xdelta3\xdelta3.h(259,1): fatal error C1189: #error:  Bad configure script
1>Done building project "xdelta3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The x64 | Release configuration also runs into the same issue, after an issue with include paths is resolved; this include path issue reports that it cannot include errno.h, and should be reported/handled separately. The Itanium | Debug and Itanium | Release configurations have another issue with the Output Path not being set, however, I have confirmed neither configuration has the required preprocessor definitions in their settings inside the xdelta3.vcxproj file.

The undeclared identifier errors occur because the preprocessor definitions do not exist in any of the configurations (other than Win32 | Debug). To fix the issue, either utilize the compilation time calculations of sizeof(size_t) and sizeof(unsigned long long) to define SIZEOF_SIZE_T and SIZEOF_UNSIGNED_LONG_LONG, respectively, or define the preprocessor symbols in the PreprocessorDefinitions segments of the rest of the configurations.

To repeat the issue:

  1. Open the xdelta3.vcxproj file in Visual Studio
  2. Select a build configuration, other than Win32 | Debug (or x64 | Release, due to the other issue with errno.h, until that is fixed)
  3. Select Build->Build Solution
  4. Observe the configuration fails to build.