View Issue Details

IDProjectCategoryView StatusLast Update
0004436libextractorbuild systempublic2017-10-12 12:06
Reporterryandesign Assigned ToChristian Grothoff Due Date
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformMacOSOS XOS Version10.11.4
Product Version1.3 
Target Version1.4Fixed in Version1.4 
Summary0004436: build fails with jpeg 9b (redefinition of enumerator 'FALSE', redefinition of enumerator 'TRUE')
DescriptionI'm the maintainer of libextractor and jpeg in the MacPorts package management system, trying to figure out how best to fix this build failure of libextractor 1.3 on OS X 10.11.4 with jpeg 9b:


In file included from jpeg_extractor.c:30:
In file included from /opt/local/include/jpeglib.h:27:
/opt/local/include/jmorecfg.h:317:16: error: redefinition of enumerator 'FALSE'
typedef enum { FALSE = 0, TRUE = 1 } boolean;
               ^
/usr/include/mach-o/dyld.h:121:20: note: previous definition is here
  enum DYLD_BOOL { FALSE, TRUE };
                   ^
In file included from jpeg_extractor.c:30:
In file included from /opt/local/include/jpeglib.h:27:
/opt/local/include/jmorecfg.h:317:27: error: redefinition of enumerator 'TRUE'
typedef enum { FALSE = 0, TRUE = 1 } boolean;
                          ^
/usr/include/mach-o/dyld.h:121:27: note: previous definition is here
  enum DYLD_BOOL { FALSE, TRUE };
                          ^
2 errors generated.


I've attached the full MacPorts log file.
Additional InformationYou'll probably see the same build failure with an unpatched jpeg 9a. In MacPorts, I have patched jpeg 9a so that this problem does not occur, but the developer of jpeg told us that this is not the correct solution and that each program that uses jpeg should be fixed instead. Here is some more info on that:

https://trac.macports.org/ticket/42735#comment:8

So I would like to update MacPorts jpeg to 9b and remove our patch, but doing so will cause this libextractor build failure.
TagsNo tags attached.
Attached Files
main.log.bz2 (20,654 bytes)

Activities

ryandesign

2016-04-20 01:33

reporter   ~0010528

Here is the patch I am now using for libextractor in MacPorts to work around this problem:

https://trac.macports.org/browser/trunk/dports/devel/libextractor/files/patch-src-plugins-jpeg_extractor.c.diff

It now builds on OS X with or without my jpeg patch. However I'm not sure that this libextractor patch is correct for use on Windows, because the jpeg headers define the boolean type differently on Windows (typedef unsigned char boolean) than they do on other operating systems (typedef int boolean). I'm not certain how the developers of jpeg intend for this type of situation to be handled by other library/application developers -- whether they are expected to reproduce that different boolean typedef.

Christian Grothoff

2016-04-30 08:17

manager   ~0010579

Should be fixed in SVN 37101.

Issue History

Date ModifiedUsernameFieldChange
2016-04-17 19:08ryandesignNew Issue
2016-04-17 19:08ryandesignFile Added: main.log.bz2
2016-04-20 01:33ryandesignNote Added: 0010528
2016-04-28 20:37Christian GrothoffAssigned To => Christian Grothoff
2016-04-28 20:37Christian GrothoffStatusnew => assigned
2016-04-30 08:17Christian GrothoffNote Added: 0010579
2016-04-30 08:17Christian GrothoffStatusassigned => resolved
2016-04-30 08:17Christian GrothoffFixed in Version => 1.4
2016-04-30 08:17Christian GrothoffResolutionopen => fixed
2016-04-30 08:17Christian GrothoffTarget Version => 1.4
2017-10-12 12:06Christian GrothoffStatusresolved => closed