I have a computer that doesn't have ImageMagick installed. I tried to copy all DLLs to that computer, but it wouldn't work. Has anyone suceeded using ImageMagick C++ APIs without installing the ImageMagick?
Thanks
Do I need to install ImageMagick to use C++ API?
The ImageMagick binaries requires Window registry entries to work properly. To remove this dependancy, compile ImageMagick from the "static" project. Next move all the programs, DLL's, and configuration files to the same directory. ImageMagick will then look in the same directory it finds the executables for any files it needs permitting you to easily redistribute ImageMagick with a minimum of fuss.
i am the author of the original post. I tried what Magick admin suggested that to build a static, though not sure I did what s/he meant. But then I cannot find the "include". After I painfully locate each header file, it still didn't work.
I wonder if there is anyone in the worl who has succeeded in deploy a C++API exe without installing magick. Two of my colleagues tried and failed too.
I wonder if there is anyone in the worl who has succeeded in deploy a C++API exe without installing magick. Two of my colleagues tried and failed too.
This worked for us. Run the configure program and choose a static build (static multi-threaded runtime). If you edit magick-config.h do not define UseInstalledImageMagick. Next build the project. You will find all the files in the folder VisualMagick/bin. Copy this files to where-ever you want on your system. This should be sufficient to run the command-line programs such as convert or identify. For development, copy magick/*.h, wand/*.h, and Magick++/lib/Magick++/*.h to this same folder. You can exclude all headers that end in -private.h. Also copy VisualMagick/lib/* to the folder. These are the libraries you need to link to. If you do not need the command line programs you can remove them from your folder (e.g. convert.exe, identify.exe, etc).
K, it doesn't work yet...
I copied the files from the directories you named into a directory I called INCLUDE and included this directory when I compiled my imageMagick project within Visual Studio 8.
First of all:
When I copy the files magick/*.h into my INCLUDE folder and then also copy the files from wand/*.h, there are some files overwritten since they exist in magick/ as well as in wand/. The same problem occurs when I copy the files from Magick++/lib/Magick++/ and in there is also the image.h which has a different size than the one which is overwritten.
Which are the files I should use now?
Second:
I can compile the program with the new INCLUDE folder but I get a runtime error when image.read() is called.
Maybe it's a bit more specific problem which may occur cuz of the call of image.read(). Was just an idea of mine...
Btw: Thanks for your patience, I feel a bit like a noob with this whole ImageMagick thing and I appreciate every help I get.
Ben
I copied the files from the directories you named into a directory I called INCLUDE and included this directory when I compiled my imageMagick project within Visual Studio 8.
First of all:
When I copy the files magick/*.h into my INCLUDE folder and then also copy the files from wand/*.h, there are some files overwritten since they exist in magick/ as well as in wand/. The same problem occurs when I copy the files from Magick++/lib/Magick++/ and in there is also the image.h which has a different size than the one which is overwritten.
Which are the files I should use now?
Second:
I can compile the program with the new INCLUDE folder but I get a runtime error when image.read() is called.
Maybe it's a bit more specific problem which may occur cuz of the call of image.read(). Was just an idea of mine...
Btw: Thanks for your patience, I feel a bit like a noob with this whole ImageMagick thing and I appreciate every help I get.
Ben
i have managed to build a static linked application that was using
my self-compiled multi-threaded static magick-libs. i also had to comment
out or #undef the HasXML, HasWMFlite and HasJP2 entries in
magick-config.h to get it linked with my own project.
i had to ignore the msvcrt.lib, too.
unfortunately i am using other libraries that won't link to a mutli-threaded-
non-dll project.
so i am currently thinking of building the dlls from source but
i have already spent several days in vain on getting the project running
with self-compiled dlls, so there might be missing those mysterious
registry-entries again...
shouldn't it be possible to use the self-compiled dynamic-multithreaded
runtimes instead WITHOUT adding any entries to the registry?
[edit]
i have finally managed to build a small example-application that could
use imagemagick/magick++ without having the binary package installed.
to do so, i built the static multi-threaded libs from the imagemagick
sources and made a DLL that is statically llinked to the magick-libs (i know
how silly this sounds), containing the function that finally calls the
magick++-routines. now i can call the function from the dll from
any application without having imagemagick installed and without needing
any magick-libs or headers in the project.
this might be a weird work-around but it works for me until now and i will
find out, if i can wrap all my functions that use use imagemagick into
that DLL.
btw. my sample-application currently only opens an image, flips it and writes
the result back to disk and the static DLL is already at 3.5mb
my self-compiled multi-threaded static magick-libs. i also had to comment
out or #undef the HasXML, HasWMFlite and HasJP2 entries in
magick-config.h to get it linked with my own project.
i had to ignore the msvcrt.lib, too.
unfortunately i am using other libraries that won't link to a mutli-threaded-
non-dll project.
so i am currently thinking of building the dlls from source but
i have already spent several days in vain on getting the project running
with self-compiled dlls, so there might be missing those mysterious
registry-entries again...
shouldn't it be possible to use the self-compiled dynamic-multithreaded
runtimes instead WITHOUT adding any entries to the registry?
[edit]
i have finally managed to build a small example-application that could
use imagemagick/magick++ without having the binary package installed.
to do so, i built the static multi-threaded libs from the imagemagick
sources and made a DLL that is statically llinked to the magick-libs (i know
how silly this sounds), containing the function that finally calls the
magick++-routines. now i can call the function from the dll from
any application without having imagemagick installed and without needing
any magick-libs or headers in the project.
this might be a weird work-around but it works for me until now and i will
find out, if i can wrap all my functions that use use imagemagick into
that DLL.
btw. my sample-application currently only opens an image, flips it and writes
the result back to disk and the static DLL is already at 3.5mb
-
- Posts: 6
- Joined: 2017-03-02T04:42:11-07:00
- Authentication code: 1151
Re: Do I need to install ImageMagick to use C++ API?
Hi
I am struggling to get it right.
Would you be kind enough to help me?
May I have your working sample application? OR Steps to get started.
I need to use the ImageMagick in my existing VS2008 project.
Please help
I am struggling to get it right.
Would you be kind enough to help me?
May I have your working sample application? OR Steps to get started.
I need to use the ImageMagick in my existing VS2008 project.
Please help