Bug 153600

Summary: cannot use libjpeg from C++ code
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Lawrence D'Oliveiro <from-novell>
Component: OtherAssignee: Vladimir Nadvornik <nadvornik>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Lawrence D'Oliveiro 2006-02-27 00:16:18 UTC
inclusion of jpeglib.h from C++ code causes link errors from being unable to find the right routine names in libjpeg.so. The following is a patch to fix the problem:

--- /usr/include/jpeglib.h-orig 2005-09-10 04:00:53.000000000 +1200
+++ /usr/include/jpeglib.h      2006-01-11 15:28:08.000000000 +1300
@@ -13,6 +13,10 @@
 #ifndef JPEGLIB_H
 #define JPEGLIB_H

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * First we include the configuration files that record how this
  * installation of the JPEG library is set up.  jconfig.h can be
@@ -1093,4 +1097,8 @@
 #include "jerror.h"            /* fetch error codes too */
 #endif

+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* JPEGLIB_H */
Comment 1 Michael Gross 2006-02-27 10:48:14 UTC
If not already done, we should include this for 10.1.
Thanks Lawrence.
Comment 2 Vladimir Nadvornik 2006-03-03 15:45:49 UTC
Other distros use this patch too (I checked debian).

Fixed.