ImageMagick Header files missing?

68 Views Asked by At

I'm trying to use ImageMagick in c++ on a Mac, but certain functions have their header files missing.

This is my code (sampled from the ImageMagick website):

#include "/Users/orlandoleone/Documents/stdc++.h"
#include <Magick++.h>

using namespace std;
using namespace Magick;


int main(int argc, char **argv) {
    InitializeMagick(*argv);
    
    // Construct the image object. Seperating image construction from the
  // the read operation ensures that a failure to read the image file
  // doesn't render the image object useless.
    Image image;
    
    try {
    // Read a file into image object
        image.read("pic.png");

    // Crop the image to specified size (width, height, xOffset, yOffset)
        image.crop( Geometry(100,100, 100, 100) );

    // Write the image to a file
        image.write("logo.png");
        
    }
    catch( Exception &error_ )
    {
        cout << "Caught exception: " << error_.what() << endl;
        return 1;
    }
    return 0;
}

But I'm given the error No matching member function for call to 'read', and the same happens for write(). crop(), on the other hand, works perfectly fine. How can I fix this?

0

There are 0 best solutions below