mieki256's diary



2019/11/15(金) [n年前の日記]

#2 [gimp] gimptool-2.0 が msys2 上で動いてくれない

Windows10 x64 1903 + msys2 上で、gimptool-2.0 を使って、GIMPプラグインのビルドができるのかどうかを試したのだけど。

_GIMP Developer Resources - How to write a GIMP plug-in

上記ページから hello.c を入手して、ビルドしてみようとしたけれど、エラーが…。

$  gimptool-2.0 --build hello.c
i686-w64-mingw32-gcc  -mms-bitfields -pthread -mms-bitfields  -ID:/msys32/mingw32/include/gimp-2.0  -ID:/msys32/mingw32/include/gegl-0.4 -ID:/msys32/mingw32/include  -ID:/msys32/mingw32/include/gio-win32-2.0  -ID:/msys32/mingw32/include/json-glib-1.0  -ID:/msys32/mingw32/include/babl-0.1 -ID:/msys32/mingw32/include  -ID:/msys32/mingw32/include/gtk-2.0  -ID:/msys32/mingw32/lib/gtk-2.0/include  -ID:/msys32/mingw32/include/pango-1.0  -ID:/msys32/mingw32/include/fribidi -ID:/msys32/mingw32/include  -ID:/msys32/mingw32/include/cairo  -ID:/msys32/mingw32/include/atk-1.0  -ID:/msys32/mingw32/include/cairo  -ID:/msys32/mingw32/include/pixman-1 -ID:/msys32/mingw32/include  -ID:/msys32/mingw32/include/freetype2  -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/harfbuzz  -ID:/msys32/mingw32/include/libpng16  -ID:/msys32/mingw32/include/gdk-pixbuf-2.0  -ID:/msys32/mingw32/include  -ID:/msys32/mingw32/lib/libffi-3.2.1/include  -ID:/msys32/mingw32/include/glib-2.0  -ID:/msys32/mingw32/lib/glib-2.0/include  -ID:/msys32/mingw32/include -o 'hello' 'hello.c'  -mwindows  -LD:/msys32/mingw32/lib -lgimpui-2.0 -lgimpwidgets-2.0  -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0  -lgimpcolor-2.0 -lgimpbase-2.0 -lgegl-0.4 -lgegl-npd-0.4  -lgmodule-2.0 -pthread -ljson-glib-1.0 -lbabl-0.1  -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32  -lole32 -Wl,-luuid -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0  -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0  -lglib-2.0 -lintl
i686-w64-mingw32-gcc: error: 'hello.c': No such file or  directory

hello.c が無い? なんでや。あるやん。

む。もしかして、'hello.c' という感じで、「'」で挟まれてしまっているあたりがいかんのでは。

これ、要するに、i686-w64-mingw32-gcc でコンパイルとリンクをすればいいということだよな…。

仮にそうであるならばと、「'」を外しつつ、あちこちを並べ替えて、gimptool-2.0 を通さずに打ってみた。

i686-w64-mingw32-gcc -o hello hello.c -mms-bitfields -pthread -mms-bitfields -ID:/msys32/mingw32/include/gimp-2.0 -ID:/msys32/mingw32/include/gegl-0.4 -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/gio-win32-2.0 -ID:/msys32/mingw32/include/json-glib-1.0 -ID:/msys32/mingw32/include/babl-0.1 -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/gtk-2.0 -ID:/msys32/mingw32/lib/gtk-2.0/include -ID:/msys32/mingw32/include/pango-1.0 -ID:/msys32/mingw32/include/fribidi -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/cairo -ID:/msys32/mingw32/include/atk-1.0 -ID:/msys32/mingw32/include/cairo -ID:/msys32/mingw32/include/pixman-1 -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/freetype2 -ID:/msys32/mingw32/include -ID:/msys32/mingw32/include/harfbuzz -ID:/msys32/mingw32/include/libpng16 -ID:/msys32/mingw32/include/gdk-pixbuf-2.0 -ID:/msys32/mingw32/include -ID:/msys32/mingw32/lib/libffi-3.2.1/include -ID:/msys32/mingw32/include/glib-2.0 -ID:/msys32/mingw32/lib/glib-2.0/include -ID:/msys32/mingw32/include -mwindows -LD:/msys32/mingw32/lib -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgegl-0.4 -lgegl-npd-0.4 -lgmodule-2.0 -pthread -ljson-glib-1.0 -lbabl-0.1 -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl

通った。hello.exe が出来上がった。

できた hello.exe を、GIMP 2.10.14 32bit Portable samj版から呼んでみた。ダイアログは開かなかったけど、エラーメッセージウインドウに「Hello, world!」と表示された。これで動作は合ってるのかな…?

_GIMP Developer Resources - How to write a GIMP plug-in, part II

上記ページから入手できる、myblur1.c と myblur2.c も、同様にビルドしてみた。これも GIMP から呼び出したら、ちゃんとぼかしフィルタとして動いてくれた。

ただ、件のサンプルは、GIMP 2.10 より古いバージョン向けに書かれたサンプルのようで、コンパイル中に、

「gimp_drawable_get は非推奨になったから、代わりに gimp_drawable_get_buffer を使え」
「gimp_drawable_detach は非推奨になったぞ」
「gimp_pixel_rgn_init の代わりに gimp_drawable_get_buffer を〜」
「gimp_pixel_rgn_get_pixel の代わりに gegl_buffer_sample を〜」

等々、大量の警告が表示された。

GIMP 2.10 から本格導入された GEGLに対応させろや、ということだよな…。それって簡単に修正できるのかな。ググってみたけど、ちょっとそういうわけにはいかない感じ。

以上です。

過去ログ表示

Prev - 2019/11 - Next
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

カテゴリで表示

検索機能は Namazu for hns で提供されています。(詳細指定/ヘルプ


注意: 現在使用の日記自動生成システムは Version 2.19.6 です。
公開されている日記自動生成システムは Version 2.19.5 です。

Powered by hns-2.19.6, HyperNikkiSystem Project