OpenPrinting / pappl-retrofit

PPD/Classic CUPS driver retro-fit Printer Application Library
Apache License 2.0
7 stars 10 forks source link

Missing types and defines when using make #16

Closed gijsn closed 9 months ago

gijsn commented 9 months ago

After installing all prerequisites: (and respective packages)

I get the following errors when making this rep (tried both the 1.0b2 and master variants on Ubuntu 22.04 (running in Windows):

  CC       legacy/printer_app-legacy-printer-app.o
  CC       pappl-retrofit/libpappl_retrofit_la-pappl-retrofit.lo
pappl-retrofit/pappl-retrofit.c: In function ‘prIdentify’:
pappl-retrofit/pappl-retrofit.c:574:3: error: unknown type name ‘cups_sc_status_t’; did you mean ‘ppd_status_t’?
  574 |   cups_sc_status_t sc_status;
      |   ^~~~~~~~~~~~~~~~
      |   ppd_status_t
pappl-retrofit/pappl-retrofit.c:627:22: warning: implicit declaration of function ‘cupsSideChannelDoRequest’ [-Wimplicit-function-declaration]
  627 |     if ((sc_status = cupsSideChannelDoRequest(CUPS_SC_CMD_SOFT_RESET, NULL,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~
pappl-retrofit/pappl-retrofit.c:627:47: error: ‘CUPS_SC_CMD_SOFT_RESET’ undeclared (first use in this function)
  627 |     if ((sc_status = cupsSideChannelDoRequest(CUPS_SC_CMD_SOFT_RESET, NULL,
      |                                               ^~~~~~~~~~~~~~~~~~~~~~
pappl-retrofit/pappl-retrofit.c:627:47: note: each undeclared identifier is reported only once for each function it appears in
pappl-retrofit/pappl-retrofit.c:630:9: error: ‘CUPS_SC_STATUS_OK’ undeclared (first use in this function); did you mean ‘IPP_STATUS_OK’?
  630 |         CUPS_SC_STATUS_OK)
      |         ^~~~~~~~~~~~~~~~~
      |         IPP_STATUS_OK
pappl-retrofit/pappl-retrofit.c: In function ‘_prPollDeviceOptionDefaults’:
pappl-retrofit/pappl-retrofit.c:3238:34: error: ‘CUPS_SC_CMD_GET_BIDI’ undeclared (first use in this function)
 3238 |     if (cupsSideChannelDoRequest(CUPS_SC_CMD_GET_BIDI, buf, &datalen,
      |                                  ^~~~~~~~~~~~~~~~~~~~
pappl-retrofit/pappl-retrofit.c:3239:42: error: ‘CUPS_SC_STATUS_OK’ undeclared (first use in this function); did you mean ‘IPP_STATUS_OK’?
 3239 |                                  5.0) != CUPS_SC_STATUS_OK ||
      |                                          ^~~~~~~~~~~~~~~~~
      |                                          IPP_STATUS_OK
pappl-retrofit/pappl-retrofit.c:3240:19: error: ‘CUPS_SC_BIDI_SUPPORTED’ undeclared (first use in this function); did you mean ‘CUPS_COPIES_SUPPORTED’?
 3240 |         buf[0] != CUPS_SC_BIDI_SUPPORTED)
      |                   ^~~~~~~~~~~~~~~~~~~~~~
      |                   CUPS_COPIES_SUPPORTED
pappl-retrofit/pappl-retrofit.c:3300:37: error: ‘CUPS_SC_CMD_GET_CONNECTED’ undeclared (first use in this function)
 3300 |     while (cupsSideChannelDoRequest(CUPS_SC_CMD_GET_CONNECTED, buf, &datalen,
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
pappl-retrofit/pappl-retrofit.c:3439:34: error: ‘CUPS_SC_CMD_DRAIN_OUTPUT’ undeclared (first use in this function)
 3439 |         cupsSideChannelDoRequest(CUPS_SC_CMD_DRAIN_OUTPUT, buf, &datalen,

I suspect it is related to the CUPS version and most probably an issue on my side.

Later I tried upgrading cups to the 3.0b2 / master in libcups and upgrading the other packages to master, which resulted in errors like below:

pappl-retrofit/pappl-retrofit.c:1135:3: error: unknown type name ‘cups_page_header2_t’; did you mean ‘cups_page_header_
’?
 1135 |   cups_page_header2_t header,              // CUPS raster headers to investigate
      |   ^~~~~~~~~~~~~~~~~~~
      |   cups_page_header_t

pappl-retrofit/pappl-retrofit.c:1547:22: error: request for member ‘HWResolution’ in something not a structure or union
 1547 |         if (optheader.HWResolution[0] != 100 ||
      |                      ^
pappl-retrofit/pappl-retrofit.c:1548:22: error: request for member ‘HWResolution’ in something not a structure or union
 1548 |             optheader.HWResolution[1] != 100)
      |                      ^
pappl-retrofit/pappl-retrofit.c:1551:24: error: request for member ‘HWResolution’ in something not a structure or union
 1551 |           if (optheader.HWResolution[0] > res[j][0])
      |                        ^
pappl-retrofit/pappl-retrofit.c:1552:34: error: request for member ‘HWResolution’ in something not a structure or union
 1552 |             res[j][0] = optheader.HWResolution[0];
      |                                  ^
pappl-retrofit/pappl-retrofit.c:1553:24: error: request for member ‘HWResolution’ in something not a structure or union
 1553 |           if (optheader.HWResolution[1] > res[j][1])
      |                        ^
pappl-retrofit/pappl-retrofit.c:1554:34: error: request for member ‘HWResolution’ in something not a structure or union
 1554 |             res[j][1] = optheader.HWResolution[1];
      |                                  ^
pappl-retrofit/pappl-retrofit.c:1619:15: error: request for member ‘HWResolution’ in something not a structure or union
 1619 |     if (header.HWResolution[0] != 100 || header.HWResolution[1] != 100)
      |               ^
pappl-retrofit/pappl-retrofit.c:1619:48: error: request for member ‘HWResolution’ in something not a structure or union
 1619 |     if (header.HWResolution[0] != 100 || header.HWResolution[1] != 100)
      |                                                ^
pappl-retrofit/pappl-retrofit.c:1621:25: error: request for member ‘HWResolution’ in something not a structure or union
 1621 |       res[1][0] = header.HWResolution[0];
      |                         ^
pappl-retrofit/pappl-retrofit.c:1622:25: error: request for member ‘HWResolution’ in something not a structure or union
 1622 |       res[1][1] = header.HWResolution[1];
      |                         ^
pappl-retrofit/pappl-retrofit.c:1834:7: error: ‘PAPPL_PWG_RASTER_TYPE_BLACK_1’ undeclared (first use in this function); did you mean ‘PAPPL_RASTER_TYPE_BLACK_1’?
 1834 |       PAPPL_PWG_RASTER_TYPE_BLACK_1 | PAPPL_PWG_RASTER_TYPE_SGRAY_8 |
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |       PAPPL_RASTER_TYPE_BLACK_1

Let me know if I need to provide other details Thanks -gijsn

gijsn commented 9 months ago

The solution to the issue above is to checkout master and rebuild. The import to cups/sidechannel.h is missing in version 1.0b2. Afterwards I got a lot of supposedly undefined cupsfilters. that was caused by libcupsfilters1 being installed in my Ubuntu system. Use dpkg -l | grep libcup as specified here and apt remove libcupsfilters1 if it exists