本文介绍了如何修复“错误:gdk-pixbuf/gdk-pixdata.h:没有这样的文件或目录?"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要旋转一个Pixbuf. vala代码包含

I need to rotate a Pixbuf. The vala code contains

using Gst, GLib, Posix, Sqlite, Gdk;
public class RotateSaveImage
{
    public void RotateSaveImage(string input, string output)
    {
        var img = new Pixbuf.from_file(input);
        var rotate_image = img.rotate_simple(PixbufRotation.CLOCKWISE);
        rotate_image.save(output, "jpeg");
    }
}

makefile包含

The makefile contains

-pkg gtk + -3.0是否应添加gdk-pixbuf/gdk-pixdata.h?

Shouldn't --pkg gtk+-3.0 add gdk-pixbuf/gdk-pixdata.h?

推荐答案

Autotools将仅使用valac将Vala代码转换为C,然后使用其对构建C的支持来将其实际编译为机器代码.这意味着您需要将相关信息添加到* _CFLAGS和* _LDFLAGS中.通常,这是通过在您的configure.ac中放入这样的内容来完成的:

Autotools will just use valac to translate the Vala code into C, then will use it's support for building C to actually compile to machine code. This means that you need to add the relevant information to *_CFLAGS ans *_LDFLAGS. Generally this is done by putting something like this in your configure.ac:

PKG_CHECK_MODULES(GIO_PIXBUF, gio-2.0)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
PKG_CHECK_MODULES(GSTREAMER_APP, gstreamer-app-0.10)
AC_SUBST(GSTREAMER_APP_CFLAGS)
AC_SUBST(GSTREAMER_APP_LIBS)
PKG_CHECK_MODULES(SQLITE, sqlite3)
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
PKG_CHECK_MODULES(GTK, gtk+-3.0)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

在Makefile.am中是这样的:

And something like this in Makefile.am:

test_VALAFLAGS = --vapidir=@VAPIDIR@ --pkg gstreamer-0.10 --pkg glib-2.0 --pkg gio-2.0 --pkg posix --thread --pkg gstreamer-app-0.10 --pkg sqlite3 --pkg gtk+-3.0

test_CFLAGS = $(GIO_CFLAGS) $(GSTREAMER_CFLAGS) $(GSTREAMER_APP_CFLAGS) $(SQLITE_CFLAGS) $(GTK_CFLAGS)

test_LDFLAGS = $(GIO_LIBS) $(GSTREAMER_LIBS) $(GSTREAMER_APP_LIBS) $(SQLITE_LIBS) $(GTK_LIBS)

这篇关于如何修复“错误:gdk-pixbuf/gdk-pixdata.h:没有这样的文件或目录?"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 10:28