Opened 3 years ago

Closed 3 years ago

#64190 closed defect (worksforme)

libjpeg-turbo: header file missing

Reported by: jasonliu-- (Jason Liu) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: jmroot (Joshua Root)
Port: libjpeg-turbo

Description

I'm working on a Portfile for a new port, that needs libjpeg as a dependency. I'm aware that we are now using libjpeg-turbo instead as a drop-in replacement. My build is currently failing with the following error message:

:info:build /opt/local/include/jpeglib.h:1122:10: fatal error: 'jpegint.h' file not found
:info:build #include "jpegint.h"            /* fetch private declarations */
:info:build          ^
:info:build 1 error generated.

Looking at jpeglib.h, it appears that the header is expecting to include additional headers:

/*
 * The JPEG library modules define JPEG_INTERNALS before including this file.
 * The internal structure declarations are read only when that is true.
 * Applications using the library should not include jpegint.h, but may wish
 * to include jerror.h.
 */

#ifdef JPEG_INTERNALS
#include "jpegint.h"            /* fetch private declarations */
#include "jerror.h"             /* fetch error codes too */
#endif

Change History (4)

comment:1 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy removed
Owner: set to mascguy
Status: newassigned

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

The port isn't doing anything special to remove jpegint.h. The libjpeg-turbo build process just doesn't install it. Seems like it is an internal header intended only for the use of libjpeg-turbo itself during the build. The software you're currently porting shouldn't be using it (or, as the case may be, shouldn't be defining JPEG_INTERNALS).

comment:3 in reply to:  2 Changed 3 years ago by jasonliu-- (Jason Liu)

Replying to ryandesign:

The port isn't doing anything special to remove jpegint.h. The libjpeg-turbo build process just doesn't install it. Seems like it is an internal header intended only for the use of libjpeg-turbo itself during the build. The software you're currently porting shouldn't be using it (or, as the case may be, shouldn't be defining JPEG_INTERNALS).

Ryan, it looks like you're right: The project's source code is indeed defining JPEG_INTERNALS:

#define JPEG_INTERNALS
//extern "C" {
#include <jpeglib.h>
//}

If I patch that file to remove the #define, the code compiles fine without the error. Since defining JPEG_INTERNALS is supposed to also include jerror.h, I suppose I could patch the source code file to add that in, since jerror.h is present as part of libjpeg-turbo's package contents.

I guess this ticket can be closed with a status of: "upstream author who is using a library improperly", although it's interesting to note that when I set the configure args to compile using the internally included libjpeg (which appears to be libjpeg 6), the compile completes fine, since in that scenario the entire libjpeg source code, including jpegint.h, is available to the build system.

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.