Gtkプログラミング on Windows!!! (478レス)
前次1-
抽出解除 レス栞

222
(1): 2009/05/14(木)20:55 AAS
>221
CentOSだけど、DISPLAYなくても動くみたい
---
.....
    g_type_init();

    pGError    = NULL;
    pGdkPixbuf = NULL;
    pGdkPixbuf = gdk_pixbuf_new_from_file(pFile, &pGError);
    if (NULL == pGdkPixbuf) {
        fprintf(stderr, "%s:%d:%s\n", pFile, pGError->code, pGError->message);
        g_error_free(pGError);
    }
    else {
        printf("Open success %s\n", pFile);
    }
.....
---
$ g++ -g 'gdk_pixbuf_new_from_file.c' `pkg-config gtk+-2.0 --libs --cflags`
$ export DISPLAY=
$ ./a.out tmp.jpg
gdk_pixbuf_new_from_file(tmp.jpg)
Open success tmp.jpg
$ ./a.out tmp.txt
gdk_pixbuf_new_from_file(tmp.txt)
tmp.txt:3:Couldn't recognize the image file format for file 'tmp.txt'
223: 2009/05/15(金)11:03 AAS
>222
返信ありがとうございます!
なるほど、g_type_initを呼ばないといけなかったのですね。
勉強不足でした。

今回初めてlinux上で開発をやらなければならなくてやってるのですけど
難しいですね・・・。英語しかないものが多くて泣きそうです。

本当に助かりました。222さん。
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ

ぬこの手 ぬこTOP 0.952s*