Hi ,    I have successfully installed ImageMagick on Windows XP and now
playing around programming interface using Visual Studio. I am trying to
compile C program( please see attachment) but facing some linking problems,

ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__DestroyMagick referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__DestroyExceptionInfo referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__DestroyImageInfo referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__DestroyImageList referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__IsImageSimilar referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__CropImage referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__CatchException referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__ReadImage referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__CloneImageInfo referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__AcquireExceptionInfo referenced in function _wmain
ImageCompare.obj : error LNK2019: unresolved external symbol
__imp__InitializeMagick referenced in function _wmain

      I compiled same program successfully on Ubuntu using gcc.

Please tell me what I am missing here ?

Thanks for help.

-- 
Thanks
Shyam.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <magick/MagickCore.h>

int main(int argc,char **argv)
{
  ExceptionInfo
    *exception;

  Image
    *crop_image,
    *image;

  ImageInfo
    *image_info;

  long
    x,
    y;

  RectangleInfo
    region;

  if (argc != 2)
    {
      (void) fprintf(stdout,"Usage: %s image image\n",argv[0]);
      exit(0);
    }
  InitializeMagick(*argv);
  exception=AcquireExceptionInfo();
  image_info=CloneImageInfo((ImageInfo *) NULL);
  (void) strcpy(image_info->filename,argv[1]);
  image=ReadImage(image_info,exception);
  if (exception->severity != UndefinedException)
    CatchException(exception);
  if (image == (Image *) NULL)
    exit(1);
  region.width=100;
  region.height=100;
  region.x=100;
  region.y=100;
  crop_image=CropImage(image,&region,exception);
  x=0;
  y=0;
  IsImageSimilar(image,crop_image,&x,&y,exception);
  printf("%ld %ld\n",x,y);
  image=DestroyImageList(image);
  image_info=DestroyImageInfo(image_info);
  exception=DestroyExceptionInfo(exception);
  DestroyMagick();
  return(0);
}
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to