5

CImg で PNG を読み込めません。最初に動作させるには libpng / zlib を取得する必要があると聞きましたが、これを設定する方法がわかりません。私はUbuntuを使用しています。私の情報源:

#include <cmath>
#include <cstdio>
#include <string>
#include <assert.h>
#include <stdarg.h>

#define cimg_using_png
#include "CImg.h"
using namespace cimg_library;
#include "png.h"

int main(int argc, char** argv)
{
    CImg<unsigned char> img2("test.png");
    img2.display();
    return 0;
}
4

1 に答える 1

7

閉じますが、必要です#define cimg_use_png

-lpngリンカーフラグに追加します。

于 2011-01-16T15:42:21.583 に答える