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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

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

Post 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!
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

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

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We have a patch for this problem in ImageMagick 6.4.1-7 Beta available sometime tomorrow.
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

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

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

To fix the compile exception, remove -pedantic from your pstoedit compile command line.
naoliv
Posts: 110
Joined: 2007-12-10T18:54:27-07:00
Location: Brazil

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

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We anticipate no problems substituting int64t and uint64t for long long and unsigned long long.
Post Reply