Noob needs help - Installation ImageMagick and VC2005

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
larrifari

Noob needs help - Installation ImageMagick and VC2005

Post by larrifari »

Hi All,

sorry to bother you but I need some help. For the last two days I have desperately been trying to install ImageMagick on my computer to use the CImg library. I downloaded and installed the binary executable file and I downloaded Magic++ API and copied all the files into my VC include directory. However I am still receiving numerous error messages, mostly related to convert.exe or some sort of permission issue. I am not installing my ImageMagick in a folder with folders, I have done quite a bit of reading and asking/googling around, but I am at the end of what I can think of to get this sorted.

Essentially I want to be able to run this particular piece of code from the CImg website, which requires ImageMagick for the jpg support.

http://cimg.sourceforge.net/reference/g ... orial.html
(see breakdown below where the lena.jpg file is loaded)

Code: Select all

  #include "CImg.h"
  using namespace cimg_library;

  int main() {
    CImg<unsigned char> image("lena.jpg"), visu(500,400,1,3,0);
    const unsigned char red[] = { 255,0,0 }, green[] = { 0,255,0 }, blue[] = { 0,0,255 };
    image.blur(2.5);
    CImgDisplay main_disp(image,"Click a point"), draw_disp(visu,"Intensity profile");
    while (!main_disp.is_closed && !draw_disp.is_closed) {
      main_disp.wait();
      if (main_disp.button && main_disp.mouse_y>=0) {
        const int y = main_disp.mouse_y;
        visu.fill(0).draw_graph(image.get_crop(0,y,0,0,image.dimx()-1,y,0,0),red,1,1,0,255,0);
        visu.draw_graph(image.get_crop(0,y,0,1,image.dimx()-1,y,0,1),green,1,1,0,255,0);
        visu.draw_graph(image.get_crop(0,y,0,2,image.dimx()-1,y,0,2),blue,1,1,0,255,0).display(draw_disp);
        }
      }
    return 0;
  }


Could somebody maybe help me with a step by step plan on how to get VC2005 to work with ImageMagick? I am running WinXP 64bit.

- I will start with a fresh installation of VC and a fresh installation of ImageMagick binary. This gives me the .exe files like convert etc.
- then copy the Magic++ folder into the VC include folder, get Magic++.h found and working via #include <Magic++.h>

but if I run the above code I get the following error messages:

convert.exe: unable to open image `C:\DOCUME~1\lf\Local`: Permission denied @ blob.c/OpenBlob/2467
`convert.exe` is not recognized as an internal or external command, operable program or batch file.

and more permission and not found errors in regards to convert.exe



why is this happening. After I compile I surely should not need any more external files, I thought after compile the executable that I created is stand-alone and will run on any machine and will not require any libraries or other executables?



and if I do a simple test with the ImageMagic API such as

Code: Select all

  #include <Magick++.h>
  using namespace Magick;

    int main( int /*argc*/, char ** argv)
    {
      InitializeMagick(*argv);
	}
I get error messages like this:
ain.obj : error LNK2019: unresolved external symbol "void __cdecl Magick::InitializeMagick(char const *)" (?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main



can anybody help me please? This is driving me insane. It must be reasonably simple to do this? Why am I having such a hard time ... :shock:
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Noob needs help - Installation ImageMagick and VC2005

Post by magick »

Go to to the ImageMagick installation folder, typically at c:/Program Files/ImageMagick-6.5.4-Q16/Magick++_demos. Click on the Button workspace. Build and run. Assuming all goes well, use the Button workspace as a template for your own custom program. It has all the proper settings to properly compile and link with Magick++.
larrifari

Re: Noob needs help - Installation ImageMagick and VC2005

Post by larrifari »

I tried this and get the following error message:

The procedure entry point ?compressType@Image@Magick@@QAEXW4CompressionType@MagickCore@@@Z could not be located in the dynamic link library CORE_RL_MAGICK++.dll


I have no idea what to do with this ...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Noob needs help - Installation ImageMagick and VC2005

Post by magick »

The button workspace has worked without fail for thousands of users over the last 10 years. If it fails to build, there is something seriously wrong with your ImageMagick installation. Unfortunately we do not know what the problem may be.
larrifari

Re: Noob needs help - Installation ImageMagick and VC2005

Post by larrifari »

Okay, I am reinstalling as we speak.

Just to be sure: I will get the windows binary installer, install it and then open the button workspace via VS, or should I not get the binary installer and just get the API (I am still confused).

Thanks!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Noob needs help - Installation ImageMagick and VC2005

Post by magick »

Post Reply