Installing Magick++
General
In order to compile Magic++ you must have access to a standard C++ implementation
and have ImageMagick
installed (ftp://ftp.wizards.dupont.com/pub/ImageMagick/).
Magick++ is co-packaged as a subdirectory of ImageMagick as of ImageMagick
version 4.2.2 and later. The author uses the egcs
1.1.2 version of GNU C++ which is available under UNIX and under the
Cygwin
UNIX-emulation environment for Windows. Standards compliant commercial
C++ compilers should also work fine. Most modern C++ compilers for PCs
should also work (project files are provided for Microsoft Visual C++ 6.0).
If your compiler does not provide an implementation of the STL, you may
be interested in trying a port of the SGI STL implementation to your compiler
available from the STL Adaptation
Page.
The compiler must support the following recent C++ standard features:
-
bool type
-
string class (<string>)
-
exceptions (<exception>)
-
namespaces
-
C++ versions of standard C headers (e.g. <cstring>)
-
Standard Template Library (STL) (e.g. <list>, <vector>)
I have personally verified that Magick++ compiles and runs using the following
compiler/platform combinations:
Tested Configurations
Operating System
|
Architecture
|
Compiler
|
Solaris 2.6 |
SPARC |
egcs 1.1.1 |
Solaris 2.6 |
SPARC |
egcs 1.1.2 |
FreeBSD 2.2.7 |
Intel Pentium II |
egcs 1.1.2 |
Windows NT 4.0 SP3 |
Intel Pentium II |
Visual C++ Standard Edition |
Please let me know if you have successfully built and executed Magick++
using a different configuration so that I can add to the table of verified
configurations.
UNIX
To install the package under Unix, installation should be similar to
./configure [ --prefix=/prefix ]
make
make install
The configure script uses the compiler/linker flags it obtains from
the installed 'Magick-config' script when performing the build. The library
is currently named similar to 'libMagick++.a' and is installed under prefix/lib
while the headers are installed under prefix/include.
To influence the options the configure script chooses, you may specify
environment variables when running the script. For example, the command
CXX=CC CXXFLAGS=-O2 LIBS=-lposix ./configure
specifies additional options to the configure script. The
following table shows the available options.
Environment Variables That Effect Configure
Environment Variable
|
Description
|
CXX
|
Name of C++ compiler (e.g. 'CC -Xa') to use compiler 'CC -Xa' |
CXXFLAGS
|
Compiler flags (e.g. '-g -O2') to compile with |
CPPFLAGS
|
Include paths (-I/somedir) to look for header files |
LDFLAGS
|
Library paths (-L/somedir) to look for libraries. Systems that support
the notion of a library run-path may additionally require -R/somedir or
'-rpath /somedir' in order to find shared libraries at run time. |
LIBS
|
Extra libraries (-lsomelib) required to link |
Windows '9X, and Windows NT
Visual C++
To build using Visual C++, extract the contents of Magick++-version.zip
(preserving sub-directories) in the ImageMagick distribution directory.
This will create the directory Magick++-version containing the sub-directories
'demo', 'doc', 'lib', and 'tests'. Open the workspace file Magick++.dsw
and build the project Magick++ in order to build the library. The library
is output to the same directory as the ImageMagick libraries.
The available projects are:
Magick++
the Magick++ library
attributes
test setting image attributes
manipulate
test manipulating images
button
program to create a simple rectangular button with
an annotation
flip
program to invert and morph images in an existing
GIF animation.
demo
program to demonstrate the image manipulation primitives
shapes
program to demonstrate use of the drawing primitives
Test and demonstration programs are built in the directory which contains
their sources. The Magick++ library is placed in the ImageMagick/lib directory
alongside the ImageMagick library.
Cygwin & EGCS
It is possible to build both ImageMagick and Magick++ under the Cygwin
Unix-emulation environment for Windows NT. Obtain and install Cgywin from
http://sourceware.cygnus.com/cygwin/
and update to the latest EGCS compiler from http://www.xraylith.wisc.edu/~khan/software/gnu-win32/egcs.html.
X11R6.4 libraries are available from http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.4/.
To build using Cygwin and EGCS, follow the instructions for building under
Unix. ImageMagick and Magick++ do not yet include support for building
Windows DLLs under Cygwin so do not enable dynamic libraries when building
ImageMagick.