nsimplex / ktools

Cross-platform (but Unix oriented) tools for modding Klei Entertainment's game Don't Starve.
GNU General Public License v2.0
156 stars 45 forks source link

Cant build with ImageMagic v7 #18

Open retnag opened 3 years ago

retnag commented 3 years ago

Environment:

$ uname -a                                                                                                                                                           
Linux  4.19.187-1-MANJARO #1 SMP Wed Apr 14 07:32:37 UTC 2021 x86_64 GNU/Linux
$ gcc -v                                                                                                                                                          
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 
$ magick --version                                                                                                                                  
Version: ImageMagick 7.0.11-7 Q16 x86_64 2021-04-12 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5) 
Delegates (built-in): bzlib cairo djvu fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff webp wmf x xml zip zlib
$ make install
Consolidate compiler generated dependencies of target ktool_common
[  3%] Building CXX object CMakeFiles/ktool_common.dir/src/common/atlas.cpp.o

In file included from /usr/include/ImageMagick-7/MagickCore/deprecate.h:27,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:100,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/magick.h:54:42: warning: comma at end of enumerator list [-Wpedantic]
   54 |   CoderEncoderSeekableStreamFlag = 0x0400,
      |                                          ^
In file included from /home/.../ktools/src/common/atlas.hpp:24,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/algebra.hpp: In function ‘void KTools::inverseOf(const KTools::ProjectiveMatrix<2, T>&)’:
/home/.../ktools/src/common/algebra.hpp:405:10: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
  405 |   return N;
      |          ^
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp: At global scope:
/home/.../ktools/src/common/image_operations.hpp:32:38: error: ‘PixelPacket’ is not a member of ‘Magick’; did you mean ‘MagickCore::PixelPacket’?
   32 |  typedef std::unary_function<Magick::PixelPacket*, void> basic_pixel_operation_t;
      |                                      ^~~~~~~~~~~
In file included from /usr/include/ImageMagick-7/MagickCore/stream.h:25,
                 from /usr/include/ImageMagick-7/MagickCore/blob.h:49,
                 from /usr/include/ImageMagick-7/MagickCore/image.h:131,
                 from /usr/include/ImageMagick-7/MagickCore/draw.h:22,
                 from /usr/include/ImageMagick-7/MagickCore/annotate.h:21,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:80,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/pixel.h:209:3: note: ‘MagickCore::PixelPacket’ declared here
  209 | } PixelPacket;
      |   ^~~~~~~~~~~
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp:32:38: error: ‘PixelPacket’ is not a member of ‘Magick’; did you mean ‘MagickCore::PixelPacket’?
   32 |  typedef std::unary_function<Magick::PixelPacket*, void> basic_pixel_operation_t;
      |                                      ^~~~~~~~~~~
In file included from /usr/include/ImageMagick-7/MagickCore/stream.h:25,
                 from /usr/include/ImageMagick-7/MagickCore/blob.h:49,
                 from /usr/include/ImageMagick-7/MagickCore/image.h:131,
                 from /usr/include/ImageMagick-7/MagickCore/draw.h:22,
                 from /usr/include/ImageMagick-7/MagickCore/annotate.h:21,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:80,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/pixel.h:209:3: note: ‘MagickCore::PixelPacket’ declared here
  209 | } PixelPacket;
      |   ^~~~~~~~~~~
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp:32:56: error: template argument 1 is invalid
   32 |  typedef std::unary_function<Magick::PixelPacket*, void> basic_pixel_operation_t;
      |                                                        ^
/home/.../ktools/src/common/image_operations.hpp:95:30: error: ‘PixelPacket’ is not a member of ‘Magick’; did you mean ‘MagickCore::PixelPacket’?
   95 |  typedef operation_t<Magick::PixelPacket*> pixel_operation_t;
      |                              ^~~~~~~~~~~
In file included from /usr/include/ImageMagick-7/MagickCore/stream.h:25,
                 from /usr/include/ImageMagick-7/MagickCore/blob.h:49,
                 from /usr/include/ImageMagick-7/MagickCore/image.h:131,
                 from /usr/include/ImageMagick-7/MagickCore/draw.h:22,
                 from /usr/include/ImageMagick-7/MagickCore/annotate.h:21,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:80,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/pixel.h:209:3: note: ‘MagickCore::PixelPacket’ declared here
  209 | } PixelPacket;
      |   ^~~~~~~~~~~
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp:95:30: error: ‘PixelPacket’ is not a member of ‘Magick’; did you mean ‘MagickCore::PixelPacket’?
   95 |  typedef operation_t<Magick::PixelPacket*> pixel_operation_t;
      |                              ^~~~~~~~~~~
In file included from /usr/include/ImageMagick-7/MagickCore/stream.h:25,
                 from /usr/include/ImageMagick-7/MagickCore/blob.h:49,
                 from /usr/include/ImageMagick-7/MagickCore/image.h:131,
                 from /usr/include/ImageMagick-7/MagickCore/draw.h:22,
                 from /usr/include/ImageMagick-7/MagickCore/annotate.h:21,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:80,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/pixel.h:209:3: note: ‘MagickCore::PixelPacket’ declared here
  209 | } PixelPacket;
      |   ^~~~~~~~~~~
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp:95:42: error: template argument 1 is invalid
   95 |  typedef operation_t<Magick::PixelPacket*> pixel_operation_t;
      |                                          ^
/home/.../ktools/src/common/image_operations.hpp:343:57: error: expected class-name before ‘{’ token
  343 |  class premultiplyPixelAlpha : public pixel_operation_t {
      |                                                         ^
/home/.../ktools/src/common/image_operations.hpp:345:29: error: ‘Magick::PixelPacket’ has not been declared
  345 |   virtual void call(Magick::PixelPacket* p) const {
      |                             ^~~~~~~~~~~
/home/.../ktools/src/common/image_operations.hpp: In member function ‘virtual void KTools::ImOp::premultiplyPixelAlpha::call(int*) const’:
/home/.../ktools/src/common/image_operations.hpp:348:29: error: request for member ‘opacity’ in ‘* p’, which is of non-class type ‘int’
  348 |    double a = 1 - double(p->opacity)/QuantumRange;
      |                             ^~~~~~~
/home/.../ktools/src/common/image_operations.hpp:352:7: error: request for member ‘red’ in ‘* p’, which is of non-class type ‘int’
  352 |    p->red = multiplyQuantum(p->red, a);
      |       ^~~
/home/.../ktools/src/common/image_operations.hpp:352:32: error: request for member ‘red’ in ‘* p’, which is of non-class type ‘int’
  352 |    p->red = multiplyQuantum(p->red, a);
      |                                ^~~
/home/.../ktools/src/common/image_operations.hpp:353:7: error: request for member ‘green’ in ‘* p’, which is of non-class type ‘int’
  353 |    p->green = multiplyQuantum(p->green, a);
      |       ^~~~~
/home/.../ktools/src/common/image_operations.hpp:353:34: error: request for member ‘green’ in ‘* p’, which is of non-class type ‘int’
  353 |    p->green = multiplyQuantum(p->green, a);
      |                                  ^~~~~
/home/.../ktools/src/common/image_operations.hpp:354:7: error: request for member ‘blue’ in ‘* p’, which is of non-class type ‘int’
  354 |    p->blue = multiplyQuantum(p->blue, a);
      |       ^~~~
/home/.../ktools/src/common/image_operations.hpp:354:33: error: request for member ‘blue’ in ‘* p’, which is of non-class type ‘int’
  354 |    p->blue = multiplyQuantum(p->blue, a);
      |                                 ^~~~
/home/.../ktools/src/common/image_operations.hpp: At global scope:
/home/.../ktools/src/common/image_operations.hpp:358:56: error: expected class-name before ‘{’ token
  358 |  class demultiplyPixelAlpha : public pixel_operation_t {
      |                                                        ^
/home/.../ktools/src/common/image_operations.hpp:360:29: error: ‘Magick::PixelPacket’ has not been declared
  360 |   virtual void call(Magick::PixelPacket* p) const {
      |                             ^~~~~~~~~~~
/home/.../ktools/src/common/image_operations.hpp: In member function ‘virtual void KTools::ImOp::demultiplyPixelAlpha::call(int*) const’:
/home/.../ktools/src/common/image_operations.hpp:363:35: error: request for member ‘opacity’ in ‘* p’, which is of non-class type ‘int’
  363 |    const double a = 1 - double(p->opacity)/QuantumRange;
      |                                   ^~~~~~~
/home/.../ktools/src/common/image_operations.hpp:368:7: error: request for member ‘red’ in ‘* p’, which is of non-class type ‘int’
  368 |    p->red = multiplyQuantum(p->red, inva);
      |       ^~~
/home/.../ktools/src/common/image_operations.hpp:368:32: error: request for member ‘red’ in ‘* p’, which is of non-class type ‘int’
  368 |    p->red = multiplyQuantum(p->red, inva);
      |                                ^~~
/home/.../ktools/src/common/image_operations.hpp:369:7: error: request for member ‘green’ in ‘* p’, which is of non-class type ‘int’
  369 |    p->green = multiplyQuantum(p->green, inva);
      |       ^~~~~
/home/.../ktools/src/common/image_operations.hpp:369:34: error: request for member ‘green’ in ‘* p’, which is of non-class type ‘int’
  369 |    p->green = multiplyQuantum(p->green, inva);
      |                                  ^~~~~
/home/.../ktools/src/common/image_operations.hpp:370:7: error: request for member ‘blue’ in ‘* p’, which is of non-class type ‘int’
  370 |    p->blue = multiplyQuantum(p->blue, inva);
      |       ^~~~
/home/.../ktools/src/common/image_operations.hpp:370:33: error: request for member ‘blue’ in ‘* p’, which is of non-class type ‘int’
  370 |    p->blue = multiplyQuantum(p->blue, inva);
      |                                 ^~~~
/home/.../ktools/src/common/image_operations.hpp: In member function ‘virtual void KTools::ImOp::pixelMap<PixelOperation>::call(Magick::Image&) const’:
/home/.../ktools/src/common/image_operations.hpp:380:13: error: ‘TrueColorMatteType’ was not declared in this scope
  380 |    img.type(TrueColorMatteType);
      |             ^~~~~~~~~~~~~~~~~~
/home/.../ktools/src/common/image_operations.hpp:387:5: error: ‘PixelPacket’ was not declared in this scope; did you mean ‘MagickCore::PixelPacket’?
  387 |     PixelPacket * RESTRICT p = view.get(0, 0, w, h);
      |     ^~~~~~~~~~~
      |     MagickCore::PixelPacket
In file included from /usr/include/ImageMagick-7/MagickCore/stream.h:25,
                 from /usr/include/ImageMagick-7/MagickCore/blob.h:49,
                 from /usr/include/ImageMagick-7/MagickCore/image.h:131,
                 from /usr/include/ImageMagick-7/MagickCore/draw.h:22,
                 from /usr/include/ImageMagick-7/MagickCore/annotate.h:21,
                 from /usr/include/ImageMagick-7/MagickCore/MagickCore.h:80,
                 from /usr/include/ImageMagick-7/Magick++/Include.h:45,
                 from /usr/include/ImageMagick-7/Magick++.h:10,
                 from /home/.../ktools/src/common/ktools_common.hpp:81,
                 from /home/.../ktools/src/common/atlas.hpp:22,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/usr/include/ImageMagick-7/MagickCore/pixel.h:209:3: note: ‘MagickCore::PixelPacket’ declared here
  209 | } PixelPacket;
      |   ^~~~~~~~~~~
In file included from /home/.../ktools/src/common/atlas.hpp:26,
                 from /home/.../ktools/src/common/atlas.cpp:18:
/home/.../ktools/src/common/image_operations.hpp:387:28: error: ‘p’ was not declared in this scope; did you mean ‘op’?
  387 |     PixelPacket * RESTRICT p = view.get(0, 0, w, h);
      |                            ^
      |                            op
/home/.../ktools/src/common/image_operations.hpp: In member function ‘virtual void KTools::ImOp::cleanNoise::call(Magick::Image&) const’:
/home/.../ktools/src/common/image_operations.hpp:423:18: error: ‘MatteChannel’ was not declared in this scope; did you mean ‘MaxPixelChannels’?
  423 |    alpha.channel(MatteChannel);
      |                  ^~~~~~~~~~~~
      |                  MaxPixelChannels
/home/.../ktools/src/common/image_operations.hpp:428:8: error: ‘class Magick::Image’ has no member named ‘matte’
  428 |    img.matte(false);
      |        ^~~~~
/home/.../ktools/src/common/image_operations.hpp:429:31: error: ‘CopyOpacityCompositeOp’ was not declared in this scope
  429 |    img.composite(alpha, 0, 0, CopyOpacityCompositeOp);
      |                               ^~~~~~~~~~~~~~~~~~~~~~
/home/.../ktools/src/common/image_operations.hpp:431:8: error: ‘class Magick::Image’ has no member named ‘matte’
  431 |    img.matte(true);
      |        ^~~~~
make[2]: *** [CMakeFiles/ktool_common.dir/build.make:132: CMakeFiles/ktool_common.dir/src/common/atlas.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:236: CMakeFiles/ktool_common.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
EVINK commented 3 years ago

Same here. Did you fix that?

EVINK commented 3 years ago

I try to compile ImageMagick-6.8.8-10 that author mentioned in README manually ( found it from https://download.imagemagick.org/ImageMagick/download/releases/ )

But unfortunately the compiler returns error from openjpeg (one of ghostscript dependencies), my ghostscript version is 9.54.0, and I try to get an old ghostscript(9.16 or 9.18 ), but there is no suitable formula for my m1 macbook.

  coders/jp2.c:1049:43: error: too few arguments to function call, expected 3, have 2
    opj_stream_set_user_data(jp2_stream,NULL);
    ~~~~~~~~~~~~~~~~~~~~~~~~                ^
  /opt/homebrew/Cellar/openjpeg/2.4.0/include/openjpeg-2.4/openjpeg.h:1229:27: note: 'opj_stream_set_user_data' declared here
  OPJ_API void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream,
                            ^
  coders/jp2.c:1050:3: error: implicit declaration of function 'opj_stream_destroy_v3' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    opj_stream_destroy_v3(jp2_stream);
    ^
  15 errors generated.