Ted Tsui wrote:
> Hi All,
>
> I am trying to install the image package and get the following errors.
> Any suggestions?
>
> Thanks,
> Ted
>
>> pkg install image-1.0.10.tar.gz
> In file included from c:\Octave\3.2.3_gcc4.4.0\include/jpeglib.h:27,
> from jpgwrite.cc:18:
> c:\Octave\3.2.3_gcc4.4.0\include/jmorecfg.h:250: error: conflicting
> declaration 'typedef int boolean'
> c:\octave\3.2.3_gcc4.4.0\mingw32\bin\../lib/gcc/mingw32/4.4.0/../../../../include/rpcndr.h:52:
> error: 'boolean' has a pr
> evious declaration as 'typedef unsigned char boolean'
> mingw32-g++-4.4.0-dw2: jpgwrite.o: No such file or directory
> make: *** [jpgwrite.oct] Error 1
> 'make' returned the following error: make: Entering directory
> `/tmp/oct-2/image-1.0.10/src'
> mkoctfile __spatial_filtering__.cc
> mkoctfile __bilateral__.cc
> mkoctfile __custom_gaussian_smoothing__.cc
> mkoctfile bwlabel.cc
> mkoctfile bwfill.cc
> mkoctfile rotate_scale.cc
> mkoctfile hough_line.cc
> mkoctfile graycomatrix.cc
> mkoctfile deriche.cc
> mkoctfile __bwdist.cc
> mkoctfile nonmax_supress.cc
> mkoctfile jpgwrite.cc -ljpeg
> make: Leaving directory `/tmp/oct-2/image-1.0.10/src'
> error: called from `pkg>configure_make' in file
> C:\Octave\3.2.3_gcc4.4.0\share\octave\3.2.3\m\pkg\pkg.m near line
> 1255,
> column 2
> error: called from:
> error: C:\Octave\3.2.3_gcc4.4.0\share\octave\3.2.3\m\pkg\pkg.m at
> line 714, column 5
> error: C:\Octave\3.2.3_gcc4.4.0\share\octave\3.2.3\m\pkg\pkg.m at
> line 287, column 7
>
The problem is that the headers from the jpeg library actually need to
be patched to work on windows because otherwise there is a clash with
the 'boolean' typedef. I didn't want to do this because it causes all
sorts of different problems, so I chose the solution the wxwidget
library uses, by defining the preprocessor variable HAVE_BOOLEAN and
providing a definition for jpeg's boolean type.
I patch the image toolbox source code as follows:
diff -urN image-1.0.10-orig//src/jpgread.cc image-1.0.10//src/jpgread.cc
--- image-1.0.10-orig//src/jpgread.cc 2009-06-07 12:45:04 +0200
+++ image-1.0.10//src/jpgread.cc 2009-10-26 18:59:15 +0100
@@ -46,6 +46,11 @@
extern "C" {
#endif
+#if defined (__MINGW32__)
+#define HAVE_BOOLEAN
+#define boolean int
+#endif
+
#include "jpeglib.h"
#ifdef __cplusplus
diff -urN image-1.0.10-orig//src/jpgwrite.cc image-1.0.10//src/jpgwrite.cc
--- image-1.0.10-orig//src/jpgwrite.cc 2009-06-07 12:45:04 +0200
+++ image-1.0.10//src/jpgwrite.cc 2009-10-26 19:10:40 +0100
@@ -15,6 +15,11 @@
extern "C" {
#endif
+#if defined (__MINGW32__)
+#define HAVE_BOOLEAN
+#define boolean int
+#endif
+
#include "jpeglib.h"
#ifdef __cplusplus
benjamin
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev