Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

configure: error: Couldn't find Magick++ ...

Help
kicior
2008-11-11
2013-05-20
  • kicior
    kicior
    2008-11-11

    Hello.
    I've got a problem - my installation stops during configure complaining about missing imagemagick. Imagemagick is of course installed (includes are in /usr/include/ImageMagick/).
    ./configure --with-extra-includes=/usr/include/ImageMagick/ doesn't change anything.
    Do you have any idea how to install kxstitch on my computer?

    (Gentoo Linux, ImageMagick 6.4.4.6)

     
    • TalynBigfoot
      TalynBigfoot
      2009-01-14

      Greetings.  As much as I dislike when people do this, have you figured the issue out yet?  I am actually running into the same problem (using Gentoo even!).  I am going to start looking at the configure script to see if I can figure anything out.  If I do, I will let you know.

       
      • My appologies, I thought I had responded to this one, I can remember writing the response, but obviously not posted it.

        In answer to the question, ImageMagick may be installed, but the ImageMagic-devel package and the ImageMagick++-devel package need to be installed as well.  These contain all the relevant header files that kxstitch needs.

        I am not sure the exact package names used for different distributions but OpenSuse 10.2's are:
        ImageMagick-Magick++-devel-6.3.0.0-27.8
        ImageMagick-devel-6.3.0.0-27.8

        You shouldn't have any problems finding them and hopefully get you on the way to compiling KXStitch.

        Regards

        Steve

         
    • Alet Roux
      Alet Roux
      2009-01-19

      Hi kicior and talynbigfoot, I'm also running Gentoo (amd64), with ImageMagick 6.4.4.6. (Steve, in Gentoo there is only one ImageMagick package, and it automagically pulls the devel files in.) I have managed to solve the problem you describe (as well as some other minor ones), but have now run into other compilation. In particular, I get the following:

      make  all-recursive
      make[1]: Entering directory `/var/tmp/portage/x11-misc/kxstitch-0.8.2/work/kxstitch-0.8.2'
      Making all in kxstitch
      make[2]: Entering directory `/var/tmp/portage/x11-misc/kxstitch-0.8.2/work/kxstitch-0.8.2/kxstitch'
      Making all in pixmap
      make[3]: Entering directory `/var/tmp/portage/x11-misc/kxstitch-0.8.2/work/kxstitch-0.8.2/kxstitch/pixmap'
      make[3]: Nothing to be done for `all'.
      make[3]: Leaving directory `/var/tmp/portage/x11-misc/kxstitch-0.8.2/work/kxstitch-0.8.2/kxstitch/pixmap'
      make[3]: Entering directory `/var/tmp/portage/x11-misc/kxstitch-0.8.2/work/kxstitch-0.8.2/kxstitch'
      if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/kde/3.5/include -I/usr/qt/3/include -I.  `Magick++-config --cppflags` -DQT_NO_COMPAT -DKDE_NO_COMPAT -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -MT printdlgpage.o -MD -MP -MF ".deps/printdlgpage.Tpo" -c -o printdlgpage.o printdlgpage.cpp; \         then mv -f ".deps/printdlgpage.Tpo" ".deps/printdlgpage.Po"; else rm -f ".deps/printdlgpage.Tpo"; exit 1; fi
      In file included from printdlgpage.cpp:17:
      printdlgpage.h:15:22: error: printdlg.h: No such file or directory
      printdlgpage.cpp: In constructor ‘PrintDlgPage::PrintDlgPage(KPrinter*, QSize, QWidget*, const char*)’:
      printdlgpage.cpp:24: error: invalid use of undefined type ‘struct PrintDlgUI’
      printdlgpage.h:25: error: forward declaration of ‘struct PrintDlgUI’
      printdlgpage.cpp: In member function ‘virtual void PrintDlgPage::getOptions(QMap<QString, QString>&, bool)’:
      printdlgpage.cpp:31: error: invalid use of undefined type ‘struct PrintDlgUI’
      printdlgpage.h:25: error: forward declaration of ‘struct PrintDlgUI’
      etc etc etc

      I'm not familiar with Qt, but seems that the .ui files are never "compiled" into .h files. If anybody could help me with this, then I would be very grateful.

      Below is a Gentoo ebuild for x11-misc/kxstitch-0.8.2, as well as 3 patches that are needed to help with compilation. This was adapted from an earlier version ebuild on the sunrise overlay (www.gentoo.org/proj/en/sunrise/).

      Alet

      1/3: configure.in.Magick.patch: I removed the check because I simply couldn't get it to work (perhaps somebody else can help to fix it):

      --- configure.in        2008-12-06 22:14:24.000000000 +0000
      +++ configure.in        2009-01-19 16:15:10.000000000 +0000
      @@ -67,7 +67,7 @@

      dnl PACKAGE set before
      AC_LANG(C++)
      -AC_CHECK_HEADERS(Magick++.h,,[AC_MSG_ERROR([Couldn't find Magick++ header file.  Install the ImageMagick++ devel package])])
      +#AC_CHECK_HEADERS(Magick++.h,,[AC_MSG_ERROR([Couldn't find Magick++ header file.  Install the ImageMagick++ devel package])])
      KDE_CREATE_SUBDIRSLIST
      AC_CONFIG_FILES([ Makefile ])
      AC_CONFIG_FILES([ doc/Makefile ])
      ============================================

      2/3: Makefile.am.Magick.patch: To include ImageMagick include directories:

      --- kxstitch/Makefile.am        2008-09-29 23:12:33.000000000 +0100
      +++ kxstitch/Makefile.am        2009-01-19 16:26:37.000000000 +0000
      @@ -10,7 +10,7 @@
                           palettemanagerdialog.cpp charselecttable.cpp charselectordialog.cpp alphaselect.cpp \                      printdlg.ui patternpropertiesdlg.ui importimage.ui extendpattern.ui palettemanagerdlg.ui charselectordlg.ui \                      configurationdlg.ui calibratedlg.ui loadpalettedlg.ui newcolordlg.ui patternlibrarydlg.ui texttooldlg.ui
      -kxstitch_LDADD   = -lkdeprint -lMagick++ -lMagick $(LIB_KFILE) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) $(LIBSOCKET)
      +kxstitch_LDADD   = -lkdeprint $(LIB_KFILE) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) $(LIBSOCKET)

      SUBDIRS = pixmap

      @@ -75,12 +75,12 @@
      # kde_wallpaperdir  Where general wallpapers should go to.

      # set the include path for X, qt and KDE
      -INCLUDES= $(all_includes)
      +INCLUDES= $(all_includes) `Magick++-config --cppflags`

      METASOURCES = AUTO

      # the library search path.
      -kxstitch_LDFLAGS = $(all_libraries) $(KDE_RPATH)
      +kxstitch_LDFLAGS = $(all_libraries) $(KDE_RPATH) `Magick++-config --ldflags`

      rcdir = $(kde_datadir)/kxstitch
      rc_DATA = kxstitchui.rc
      ============================================

      3/3: flossscheme.cpp.patch: To fix reference to obsolete MagickLib:

      --- kxstitch/flossscheme.cpp    2008-09-23 23:54:46.000000000 +0100
      +++ kxstitch/flossscheme.cpp    2009-01-19 17:08:49.000000000 +0000
      @@ -69,7 +69,7 @@
           *pixel++ = (char)0xff;
           *pixel++ = (char)0xff;
           *pixel++ = (char)0;
      -    m_map = new Magick::Image(it.count() + 1, 1, "RGBA", MagickLib::CharPixel, pixels);
      +    m_map = new Magick::Image(it.count() + 1, 1, "RGBA", MagickCore::CharPixel, pixels);
           delete pixels;
         }
         return m_map;
      @@ -82,7 +82,7 @@
         c[0] = (char)color.red();
         c[1] = (char)color.green();
         c[2] = (char)color.blue();
      -  Magick::Image image = Magick::Image(1, 1, "RGB", MagickLib::CharPixel, c);
      +  Magick::Image image = Magick::Image(1, 1, "RGB", MagickCore::CharPixel, c);
         image.map(*m_map);
         Magick::Pixels cache(image);
         const Magick::PixelPacket *pixels = cache.get(0,0,1,1);
      ============================================

      Finally, the ebuild:--- kxstitch/Makefile.am        2008-09-29 23:12:33.000000000 +0100

      # Copyright 1999-2008 Gentoo Foundation
      # Distributed under the terms of the GNU General Public License v2
      # $Header: $

      inherit eutils kde

      DESCRIPTION="A program to create cross stitch patterns and charts"
      HOMEPAGE="http://kxstitch.sourceforge.net/"
      SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

      LICENSE="GPL-2"
      SLOT="0"
      KEYWORDS="~amd64 ~x86"
      IUSE="imagemagick scanner"

      DEPEND="imagemagick? ( media-gfx/imagemagick )
              scanner? ( media-gfx/sane-backends )"
      RDEPEND="${DEPEND}"

      src_unpack() {
              unpack ${A}
              cd "${S}"
              epatch "${FILESDIR}/Makefile.am.Magick.patch"
              epatch "${FILESDIR}/configure.in.Magick.patch"
              epatch "${FILESDIR}/flossscheme.cpp.Magick.patch"

              eautoreconf
              ./configure
      }

      src_compile() {
              emake
      }

      pkg_setup() {
              if use imagemagick && built_with_use media-gfx/imagemagick nocxx ; then
                      eerror "Building kxstitch requires imagemagcik built without"
                      eerror "the nocxx use flag to build magick++ (the C++ API)."
                      eerror "Please re-emerge imagemagick with this use flag disabled."
                      die "imagemagick missing magick++"
              fi
      }

      ============================================

       
      • Unfortunately I am no expert with Gentoo or make for that matter.  I can't explain why the ui files are not compiled.  I notice with make on my SuSE 10.2 that the ui files are the first things to be compiled.

        I notice at the bottom of your post the pkg_setup() might suggest that ImageMagick is built without the C++ support, hence no Magick++.h file.  Is this the case? It would explain why the configure test fails.

        I will try and get some time this weekend and install Gentoo on vmware and see if I can replicate and solve the problems, or hopefully some expert can suggest a solution.

        Regards

        Steve

         
        • Out of interest, have you tried using the CVS sources instead of a release.  It may be something generated in the configure script that is at fault.

          Regards

          Steve

           
        • Alet Roux
          Alet Roux
          2009-01-19

          Hi Steve, ImageMagick was definitely built with the C++ support, and Magick++.h is where it should be, as are all the libraries, but for the life of me I can't persuade configure to look in the right place for it (even with --with-extra-includes).

          As to your other suggestion, good idea, I will have a look at the CVS source soon.

           
          • OK, some good news and some bad news.

            I downloaded gentoo.2008 live cd and installed it in vmware.  I did an emerge of kde-meta (and didn't that take a while).  I downloaded kxstitch-0.8.3 from sourceforge and unzipped it.  ./configure went without a problem, the imagemagick check worked and compiling and installing was successful.

            So unfortunately I can't replicate the problems that your having and have therefore no chance of fixing it.  It would suggest the gentoo and kxstitch can get on, but there is something not quite right somewhere.

            I am not sure where to look now!

             
            • Alet Roux
              Alet Roux
              2009-01-30

              Hi, thanks for checking! This is very mysterious indeed, because I have Gentoo 2008.0 also, and before this ImageMagick problem I was a very happy user of kxstitch 0.8.

              I'm no expert in these things, but the only thing I can't wheadle my way around at the moment is the non-compilation of the ui files. Which version(s) of qt do you have on your gentoo system? (I have 3.3.8b-r1 and 4.4.2) Do you perhaps know how one would compile these by hand? (to check that it works).

              Alet

               
              • I have qt-3.3.8-r4, perhaps it was updated with the kde-meta.

                I have uploaded a full installed package list at
                http://kxstitch.sourceforge.net/gentoo_installed_packages

                I have also uploaded a kxstitch build log for gentoo at
                http://kxstitch.sourceforge.net/kxstitch_build

                Could it possibly be something to do with having qt4 installed as well?
                I have also been reading up on USE flags and I notice there is one for ImageMagick.  Might be clutching at straws with that one!

                 
                • Oops, type there, the build log is at
                  http://kxstitch.sourceforge.net/kxstitch-build

                   
                • Alet Roux
                  Alet Roux
                  2009-02-01

                  Hi Steve, thanks for this. Looking at your list of installed packages, I downgraded some of my packages, and managed to install kxstitch 0.8.3 on my system.

                  * I had qt-3.3.8b-r4 on my system, and had to downgrade to 3.3.8-r4 (I say "downgrade" because portage reckons qt-3.3.8b-r4 is the most recent version). Not sure what the difference is between the two versions, except that one works with kxstitch and the other doesn't. I still have qt4 on my system; no change there.

                  * I had imagemagick-6.4.4.6, and downgraded to 6.3.3 (this is the most recent version of the 6.3 series available on portage). This is more serious, because there is a big difference between the version of imagemagick working with kxstitch and the most recent stable version (6.4.4.6 on gentoo).

                  So the good news is that at least I now have a working version, and can investigate further.

                  I don't think the imagemagick use flag is relevant here - use flags are used to implement optional dependencies, whereas the dependency on imagemagick is compulsory here.

                   
                  • It is certainly a strange situation.  I am no Gentoo expert, I read enough to download and install it and try out KXStitch, which worked for me.

                    Thankfully you have now got a working installation, but there must be something in the differences between the versions that isn't allowing a compilation.  I will try updating the packages and I have to see if I can see where the problem is.

                    Regards

                    Steve

                     
    • Alet Roux
      Alet Roux
      2009-02-08

      Hi Steve

      I've done some further testing, and this is what I've come up with:

      Imagemagick-6.3, Qt-3.3.8: Works fine.
      Imagemagick-6.3, Qt-3.3.8b: Works fine.
      Imagemagick-6.4, Qt-3.3.8: Fails as described above.
      Imagemagick-6.4, Qt-3.3.8b: Fails as described above.

      So, although for some weird reason the change in ImageMagick version causes Qt errors, it is not Qt itself that is at fault (if that makes sense). So now my question is: Does kxstitch (normally) work with ImageMagick 6.4? If not, do you perhaps have any plans of porting it in future?

      By the way, I found a way of checking for the imagemagick-devel package that works with my version of ImageMagick (6.4.4.6). In the file configure.in, simply replace the line

      AC_CHECK_HEADERS(Magick++.h,,[AC_MSG_ERROR([Couldn't find Magick++ header file.  Install the ImageMagick++ devel package])])

      with

      PKG_CHECK_MODULES(IMAGEMAGICK, ImageMagick++,,[AC_MSG_ERROR([Couldn't find Magick++ header file.  Install the ImageMagick++ devel package])])
      AC_SUBST(IMAGEMAGICK_LIBS)
      AC_SUBST(IMAGEMAGICK_CFLAGS)

      This means that it is possible, for example, to write in kxstitch/Makefile.am:

      INCLUDES= $(all_includes) $(IMAGEMAGICK_CFLAGS)

      Hope this is useful.

      Best wishes

      Alet

       
      • Alet

        I have done a clean install of OpenSuSE 11.1 with KDE 3.5.10, Qt 3.3.8b, ImageMagick 6.4.3.6 and used a tarball of KXStitch 0.8.3 from Sourceforge.

        The first thing I encountered was configure not finding Magick++.h, it is there, but as with Gentoo it is not being found.  I used the update to configure.in.in that you provided and rebuilt the makefiles.  This then worked, thanks for that,  It also works with OpenSuSE 10.2 with the older version of ImageMagick.

        I have found that KXStitch now needs to be linked to the MagickCore lib in 6.4, not the Magick lib, which doesn't seem to exist now.  Replacing the references in kxstitch_LDADD in kxstitch/Makefile.am for the magick libs to $(IMAGEMAGICK_LIBS) solves that little problem.  Again this works for the older version too.

        There has also been some namespace changes in that MagickLib::CharPixel is now MagickCore::CharPixel, so changing these in flossscheme.cpp fixed that.  Unfortunately this doesn't work in with the 6.3 version so I will have to put a conditional compilation in there when I can work out how to get the version number.

        The good news is that there doesn't seem to be any real problem with Magick 6.4, it is just the namespace change that messed it up.  I will sort out the conditionals and post a patch for you to test out with Gentoo, if you don't beat me to it, and hopefully if everything is ok, release it on sourceforge.

        Thanks for the input, it has been invaluable.

        Regards

        Steve

         
        • I have made an update to CVS with a better method for check ImageMagick which will also retrieve the version number.  There is also a conditional compilation which should resolve the namespace issue between versions 6.3 and 6.4 of ImageMagick.

          If you can check out the source, it is tagged with KXStitch_0_8_3_1_RELEASE, and check it on your own systems and let me know if it works or not.

          If you can't use CVS then I will release this one in a few days.

          Regards

          Steve

           
        • Alet Roux
          Alet Roux
          2009-02-21

          Hi Steve

          Sorry for the delay in answering (I've been busy sorting out problems with upgrading to KDE 4.2). I have just installed kxstitch 0.8.3.1 and it went very smoothly. Thanks a lot for your hard work!

          Alet

          PS. I've uploaded the Gentoo ebuilds to http://bugs.gentoo.org/show_bug.cgi?id=63847.

           
          • Thank you Alet.  You contributed to the solution.  Thanks for testing it.