Bug 153600 - cannot use libjpeg from C++ code
Summary: cannot use libjpeg from C++ code
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Other (show other bugs)
Version: unspecified
Hardware: All SuSE Linux 10.0
: P5 - None : Normal
Target Milestone: ---
Assignee: Vladimir Nadvornik
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 00:16 UTC by Lawrence D'Oliveiro
Modified: 2006-03-03 15:45 UTC (History)
0 users

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.