I'm new to C and it probably shows.
compile options:
Code: Select all
cc `MagickWand-config --cflags --cppflags` test.c `MagickWand-config --ldflags --libs` -o test
Code: Select all
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wand/MagickWand.h>
MagickWand
*magick_wand;
MagickWand
*composite_wand;
int main()
{
FILE *fout;
FILE *fin;
MagickWandGenesis();
magick_wand = NewMagickWand();
composite_wand = NewMagickWand();
fin = fopen("image.jpg", "r");
MagickReadImageFile(magick_wand, fin);
fclose(fin);
fin = fopen("image2.jpg", "r");
MagickReadImageFile(composite_wand, fin);
fclose(fin);
MagickCompositeImage(magick_wand, composite_wand, DifferenceCompositeOP, 0, 0);
fout = fopen("newimage.jpg", "w");
MagickWriteImageFile(magick_wand, fout);
MagickWandTerminus();
return(0);
}
Error:
Code: Select all
test.c: In function 'main':
test.c:49: error: 'DifferenceCompositeOP' undeclared (first use in this function)
test.c:49: error: (Each undeclared identifier is reported only once
test.c:49: error: for each function it appears in.)