0

Code::Blocks で Magick++ を使用しようとしています (どちらも最新バージョンです)。私はwin7 x64を使用しており、ImageMagick x86とx64の両方を動的にインストールしました(DLLを使用)。

デモ C++ ファイル (以下のコードなど) を実行しようとするたびに、同じメッセージが表示されます。

\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)

誰もこれを経験したことがありますか?それを機能させるのを手伝ってもらえますか?

.jpgプロジェクトと同じフォルダに「wall.jpg」というファイルを置きます。

ありがとう

magick++demoフォルダーのソース コード

#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;
}
4

4 に答える 4

1

入力パスにエラーが設定されているか、アカウントに "C:\Users\ad\Desktop\C++\Magick++\test\main.cpp" 内のファイルを読み取る権限がない可能性があります。確認してからやり直してください。

于 2013-07-18T09:11:32.050 に答える
1


こんにちは 、

出力例が示すように、問題は「wall.jpg」の欠落ではなく、コンパイルプロセス(実行可能バイナリの作成)です。

mingw32-g++.exe: fatal error: no input files

何が問題なのかを調べるには、実行したコマンドと完全なエラー出力を投稿する必要があります。


一番、

ジャック

于 2013-07-16T08:44:30.087 に答える
0

main:InitializeMagick(*argv) の最初の文でエラーが発生したと思います。この呼び出しにデバッグできます。argv の NULL ポインターが原因である可能性があります。

ああ、いや、プロジェクトはコンパイルさえしませんでした! (エラー メッセージを参照)

于 2013-07-16T01:37:38.527 に答える
0

プロジェクトの作成に使用した方法を修正する必要があると思います。個人的には、プロジェクトの作成方法を再確認し、幸運にも機能しました。

于 2013-11-26T17:45:26.220 に答える