MantisBT - CMake
View Issue Details
0011780CMakeCMakepublic2011-02-01 03:072015-07-08 08:57
Dongsheng Song 
Stephen Kelly 
normalminoralways
closedfixed 
Windows
 
CMake 3.2 
0011780: CMake cannot building by VC6 with PSDK
Tested with PSDK February 2003 edition.

C:\>set inc
INCLUDE=C:\Program Files\Microsoft SDK\include;C:\opt\vs1998\vc98\include

C:\>set lib
LIB=C:\Program Files\Microsoft SDK\lib;C:\opt\vs1998\vc98\lib

In Utilities\cmlibarchive\libarchive\archive_windows.c, the following code is not correct:

#if defined(_MSC_VER) && _MSC_VER < 1300
/* VS 6 does not provide SetFilePointerEx, so define it here. */
static BOOL SetFilePointerEx(HANDLE hFile,
                             LARGE_INTEGER liDistanceToMove,
                             PLARGE_INTEGER lpNewFilePointer,
                             DWORD dwMoveMethod)
{
  LARGE_INTEGER li;
  li.QuadPart = liDistanceToMove.QuadPart;
  li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod);
  if(lpNewFilePointer) { lpNewFilePointer->QuadPart = li.QuadPart; }
  return li.LowPart != -1 || GetLastError() == NO_ERROR;
}
#endif

Because VC6 with PSDK have SetFilePointerEx, we should use VER_PRODUCTBUILD which defined in <ntverp.h>:

#include <ntverp.h>

/* Windows 2000/XP or later have SetFilePointerEx defined */
#if (_MSC_VER < 1300) && (VER_PRODUCTBUILD < 2600)
static BOOL SetFilePointerEx(HANDLE hFile,
                             LARGE_INTEGER liDistanceToMove,
                             PLARGE_INTEGER lpNewFilePointer,
                             DWORD dwMoveMethod)
{
  LARGE_INTEGER li;
  li.QuadPart = liDistanceToMove.QuadPart;
  li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod);
  if(lpNewFilePointer) { lpNewFilePointer->QuadPart = li.QuadPart; }
  return li.LowPart != -1 || GetLastError() == NO_ERROR;
}
#endif
O:\vcs\git\cmake\Utilities\cmlibarchive\libarchive\archive_windows.c(74) : error C2373: 'SetFilePointerEx' : redefinition; different type modifiers
        C:\Program Files\Microsoft SDK\include\winbase.h(3393) : see declaration of 'SetFilePointerEx'
NMAKE : fatal error U1077: 'C:\opt\vs1998\VC98\Bin\CL.EXE' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\opt\vs1998\vc98\bin\NMAKE.EXE' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'C:\opt\vs1998\vc98\bin\NMAKE.EXE' : return code '0x2'
Stop.
No tags attached.
Issue History
2011-02-01 03:07Dongsheng SongNew Issue
2012-08-11 11:09David ColeStatusnew => backlog
2012-08-11 11:09David ColeNote Added: 0030226
2015-02-26 15:22Stephen KellyNote Added: 0038086
2015-02-26 15:22Stephen KellyStatusbacklog => resolved
2015-02-26 15:22Stephen KellyFixed in Version => CMake 3.2
2015-02-26 15:22Stephen KellyResolutionopen => fixed
2015-02-26 15:22Stephen KellyAssigned To => Stephen Kelly
2015-07-08 08:57Robert MaynardNote Added: 0039074
2015-07-08 08:57Robert MaynardStatusresolved => closed

Notes
(0030226)
David Cole   
2012-08-11 11:09   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0038086)
Stephen Kelly   
2015-02-26 15:22   
CMake 3.2 is not expected to build with MSVC6 at all. Use an alternative compiler to build cmake itself on Windows.
(0039074)
Robert Maynard   
2015-07-08 08:57   
Closing resolved issues that have not been updated in more than 4 months.