Bugzilla – Bug 153600
cannot use libjpeg from C++ code
Last modified: 2006-03-03 15:45:49 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 */
If not already done, we should include this for 10.1. Thanks Lawrence.
Other distros use this patch too (I checked debian). Fixed.