Project

General

Profile

Bug #9097

RawSpeed's #include of jpeglib.h needs __cplusplus guards

Added by James C. McPherson almost 6 years ago. Updated about 5 years ago.

Status:
Fixed
Priority:
Low
Category:
General
Start date:
11/28/2012
Due date:
% Done:

100%

Estimated time:
1.00 h
Affected Version:
1.1.0
System:
unknown
bitness:
64-bit
hardware architecture:
amd64/x86

Description

The updated RawSpeed library needs to guard its #include <jpeglib.h> so that it's not compiled with C++-isms.

History

#1 Updated by James C. McPherson almost 6 years ago

The fix is simple:

$ git diff src/external/rawspeed/RawSpeed/StdAfx.h
diff --git a/src/external/rawspeed/RawSpeed/StdAfx.h b/src/external/rawspeed/RawSpeed/StdAfx.h
index cbdb0c8..0088ea0 100644
--- a/src/external/rawspeed/RawSpeed/StdAfx.h
+++ b/src/external/rawspeed/RawSpeed/StdAfx.h
@ -65,7 +65,13 @
#endif
#endif

#ifdef __cplusplus
+extern "C" {
#endif
#include "jpeglib.h"
#ifdef __cplusplus
}
+#endif

// STL
#include &lt;iostream&gt;

#2 Updated by James C. McPherson almost 6 years ago

  • % Done changed from 0 to 70
  • Status changed from New to Patch attached

Failure to fix this results (on Solaris, at least) in this collection of error messages from the linker:

Undefined first referenced
symbol in file
jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned int) libdarktable.so
jpeg_resync_to_restart(jpeg_decompress_struct*, int) libdarktable.so
jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned int) libdarktable.so
jpeg_read_header(jpeg_decompress_struct*, int) libdarktable.so
jpeg_std_error(jpeg_error_mgr*) libdarktable.so
jpeg_finish_decompress(jpeg_decompress_struct*) libdarktable.so
jpeg_destroy_decompress(jpeg_decompress_struct*) libdarktable.so
jpeg_start_decompress(jpeg_decompress_struct*) libdarktable.so

#3 Updated by James C. McPherson almost 6 years ago

  • % Done changed from 70 to 90
  • Estimated time set to 1.00
  • Status changed from Patch attached to Fixed: To be cherry-picked

I referred to the wrong bug in my commit comments (9907 rather than 9097).

This issue is fixed in:

I'll push this in to git master tomorrow.

#4 Updated by Simon Spannagel about 5 years ago

  • System set to unknown
  • Status changed from Fixed: To be cherry-picked to Fixed
  • % Done changed from 90 to 100

Also available in: Atom PDF