[cups.bugs] [MOD] STR #3781: Can't build Windows CUPS 1.4.5 with Visual Studio 2005

Ken Sharp ken.sharp at artifex.com
Mon Jan 24 08:39:05 PST 2011


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

There are several problems, some are resolved with the Visual Studio 2008
solution, but others persist into 1.5 even with the Visual Studio 2008
solution.

In fact I'm not using the solutions, since I'm building CUPS to work with
Ghostscript and need my own makefile, and some of the issues stem from
inclusion path problems.

1) The solution attempts to compile 'pwgmedia.c', the correct filename is
'pwg-media.c'

2) Two required C files are not built by the solution, 'pwg-file.c' and
'pwg-ppd.c'

3) The Windows config.h file (in vcnet) has a version string of 1.4.4.

4) The supplied config.h includes definitions of strcasecmp and
strncasecmp in terms of stricmp and strnicmp. However it does not set the
'HAVE_STRCASECMP' or 'HAVE_STRNCASECMP' variables. Due to inclusion order,
this could lead to files expecting cups_strcascmp and an unresolved
external because the file defining cups_strcasecmp *did* have
HAVE_STRCASECMP defined, and so did not declare the function. 

5) in debug.c, the code unconditionally uses debug_mutex, but that
variable is only declared if HAVE_PTHREAD_H is defined, which it isn't for
Windows. Similarly for debug_filter.

6) gettimeofday (debug.c) is not defined on Windows.

7) sidechannel.c isn't used in the build, but if it ever does get used
then it needs to include <winsock2.h> as HAVE_POLL is not true on Windows
systems, and so select will be used instead, which requires this header.

8) In image_bmp.c the BI_* constants are already defined on Windows.

9) In image_colorspace.c, cbrt is not defined in the run-time by MSVC.

10) In image_tiff.c, if HAVE_LIBTIFF is 1 then the code includes
<unistd.h> unconditionally, which header is not present on Windows.


My final problem is 'odd' and is probably another inclusion order issue.
In ppd.c "string.h" (the local include) gets included twice and <string.h>
doesn't get included at all. This leads to strchr being undefined and
causes a compiler error.

Link: http://www.cups.org/str.php?L3781
Version: 1.4.5
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: string.h.patch
URL: <https://lists.cups.org/pipermail/cups/attachments/20110124/8dd83a1e/attachment.ksh>


More information about the cups mailing list