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

  • kicior

    kicior - 2008-11-11

    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

    • 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.

      • Stephen Allewell

        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:

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



    • Alet Roux

      Alet Roux - 2009-01-19

      Hi kicior and talynbigfoot, I'm also running Gentoo (amd64), with ImageMagick (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 (


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

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

      dnl PACKAGE set before
      -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])])
      AC_CONFIG_FILES([ Makefile ])
      AC_CONFIG_FILES([ doc/Makefile ])

      2/3: To include ImageMagick include directories:

      --- kxstitch/        2008-09-29 23:12:33.000000000 +0100
      +++ kxstitch/        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`


      # 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);
         c[1] = (char);
         c[2] = (char);
      -  Magick::Image image = Magick::Image(1, 1, "RGB", MagickLib::CharPixel, c);
      +  Magick::Image image = Magick::Image(1, 1, "RGB", MagickCore::CharPixel, c);*m_map);
         Magick::Pixels cache(image);
         const Magick::PixelPacket *pixels = cache.get(0,0,1,1);

      Finally, the ebuild:--- kxstitch/        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"

      KEYWORDS="~amd64 ~x86"
      IUSE="imagemagick scanner"

      DEPEND="imagemagick? ( media-gfx/imagemagick )
              scanner? ( media-gfx/sane-backends )"

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


      src_compile() {

      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++"


      • Stephen Allewell

        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.



        • Stephen Allewell

          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.



        • 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.

          • Stephen Allewell

            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).


              • Stephen Allewell

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

                I have uploaded a full installed package list at

                I have also uploaded a kxstitch build log for gentoo at

                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!

                • Stephen Allewell

                  Oops, type there, the build log is at

                • 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-, 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 ( 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.

                  • Stephen Allewell

                    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.



    • 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 ( In the file, simply replace the line

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


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

      This means that it is possible, for example, to write in kxstitch/

      INCLUDES= $(all_includes) $(IMAGEMAGICK_CFLAGS)

      Hope this is useful.

      Best wishes


      • Stephen Allewell


        I have done a clean install of OpenSuSE 11.1 with KDE 3.5.10, Qt 3.3.8b, ImageMagick 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 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/ 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.



        • Stephen Allewell

          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.



        • 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 and it went very smoothly. Thanks a lot for your hard work!


          PS. I've uploaded the Gentoo ebuilds to

          • Stephen Allewell

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


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks