Page 1 of 1

"ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-06T18:59:50-07:00
by naoliv
Really sorry if this problem doesn't belong to ImageMagick, but while compiling pstoedit here, it failed with this error:

Code: Select all

 c++ -Wl,--as-needed -Wl,-O1 -DPACKAGE_NAME=\"pstoedit\" -DPACKAGE_TARNAME=\"pstoedit\" -DPACKAGE_VERSION=\"3.45\" "-DPACKAGE_STRING=\"pstoedit 3.45\"" -DPACKAGE_BUGREPORT=\"wglunz34_AT_pstoedit.net\" -DPACKAGE=\"pstoedit\" -DVERSION=\"3.45\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_DIRENT_H=1 -I. -I. -DHAVE_LIBPLOTTER -DHAVE_MKSTEMP -DHAVE_MAGIC -fopenmp -I/usr/include/ImageMagick -DHAVE_LIBPNG -DDEFAULTGS=/usr/bin/gs -DPSTOEDITDATADIR=\"/usr/share/pstoedit\" -DPSTOEDITLIBDIR=\"/usr/lib/pstoedit\" -DBUGGYGPP -pedantic -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -D_LITTLE_ENDIAN -g -MT drvmagick++.lo -MD -MP -MF .deps/drvmagick++.Tpo -c drvmagick++.cpp  -fPIC -DPIC -o .libs/drvmagick++.o
In file included from /usr/include/ImageMagick/magick/MagickCore.h:147,
                 from /usr/include/ImageMagick/Magick++/Include.h:47,
                 from /usr/include/ImageMagick/Magick++/Image.h:11,
                 from /usr/include/ImageMagick/Magick++.h:9,
                 from drvmagick++.h:35,
                 from drvmagick++.cpp:31:
/usr/include/ImageMagick/magick/magick-type.h:124: error: ISO C++ 1998 does not support 'long long'
/usr/include/ImageMagick/magick/magick-type.h:125: error: ISO C++ 1998 does not support 'long long'
In file included from /usr/include/ImageMagick/magick/MagickCore.h:166,
                 from /usr/include/ImageMagick/Magick++/Include.h:47,
                 from /usr/include/ImageMagick/Magick++/Image.h:11,
                 from /usr/include/ImageMagick/Magick++.h:9,
                 from drvmagick++.h:35,
                 from drvmagick++.cpp:31:
/usr/include/ImageMagick/magick/deprecate.h:75: error: ISO C++ 1998 does not support 'long long'
/usr/include/ImageMagick/magick/deprecate.h:76: error: ISO C++ 1998 does not support 'long long'
make[2]: *** [drvmagick++.lo] Error 1
ImageMagick version is 6.4.1.3
Is this a problem with IM, please?

Thank you!

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-08T16:22:56-07:00
by naoliv
Hi!

Is this a correct patch, please?

Code: Select all

diff -ur ImageMagick/magick/deprecate.h ImageMagick.new/magick/deprecate.h
--- ImageMagick/magick/deprecate.h      2008-05-21 16:12:55.000000000 -0300
+++ ImageMagick.new/magick/deprecate.h  2008-06-08 20:21:13.000000000 -0300
@@ -72,8 +72,8 @@

 #if !defined(__WINDOWS__)
 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
-typedef long long ExtendedSignedIntegralType;
-typedef unsigned long long ExtendedUnsignedIntegralType;
+typedef int64t ExtendedSignedIntegralType;
+typedef u_int64t ExtendedUnsignedIntegralType;
 #else
 typedef long ExtendedSignedIntegralType;
 typedef unsigned long ExtendedUnsignedIntegralType;
diff -ur ImageMagick/magick/magick-type.h ImageMagick.new/magick/magick-type.h
--- ImageMagick/magick/magick-type.h    2008-05-11 09:12:55.000000000 -0300
+++ ImageMagick.new/magick/magick-type.h        2008-06-08 20:21:49.000000000 -0300
@@ -121,8 +121,8 @@
 typedef unsigned int MagickStatusType;
 #if !defined(__WINDOWS__)
 #if (MAGICKCORE_SIZEOF_UNSIGNED_LONG_LONG == 8)
-typedef long long MagickOffsetType;
-typedef unsigned long long MagickSizeType;
+typedef int64t MagickOffsetType;
+typedef u_int64t MagickSizeType;
 #define MagickSizeFormat  "%10llu"
 #else
 typedef long MagickOffsetType;
Thank you!

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-08T17:29:14-07:00
by magick
We have a patch for this problem in ImageMagick 6.4.1-7 Beta available sometime tomorrow.

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-09T09:15:40-07:00
by naoliv
Hi!

I saw that magick/deprecate.h was fixed on SVN, but shouldn't magick/magick-type.h be changed too?

Thank you very much!

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-09T09:32:14-07:00
by magick
To fix the compile exception, remove -pedantic from your pstoedit compile command line.

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-09T13:07:57-07:00
by naoliv
Hi!

Just in case it's not possible to remove -pedantic, can long long be patched in our local copy to int64t and unsigned long long to u_int64t, in magick/magick-type.h (like the patch on the other message)?
Is it wrong and can this cause any troubles, please?

Thank you!

Re: "ISO C++ 1998 does not support 'long long'"

Posted: 2008-06-09T18:35:21-07:00
by magick
We anticipate no problems substituting int64t and uint64t for long long and unsigned long long.