c++imageg++codeblocksmagick++

Code::Blocks, c++, magick++ any demo results in: mingw32-g++.exe: fatal error: no input files


I am trying to use Magick++ with Code::Blocks (both are latest versions). I use win7 x64 and I installed both ImageMagick x86 and x64 dynamic (with DLLs).

Every time I try to run a demo c++ file (like the code below,) I get the same message:

\ImageMagick-6.8.6-Q16\include\"  -c C:\Users\ad\Desktop\C++\Magick++\test\main.cpp -o obj\Debug\main.o
mingw32-g++.exe: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)

does anybody has experienced this? Could you help me to make it work?

I put a .jpg file "wall.jpg" in the same folder as the project.

Thanks

Source code from the magick++ demo folder

#include <Magick++.h>
#include <iostream>
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( "wall.jpg" );

    // 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( "x.gif" );
  }
  catch( Exception &error_ )
    {
      cout << "Caught exception: " << error_.what() << endl;
      return 1;
    }
  return 0;
}

Solution

  • may be your input path is error set or your account don't have privilege to read the file in "C:\Users\ad\Desktop\C++\Magick++\test\main.cpp",check it and try again