如何修复错误:gdk-pixbuf/gdk-pixdata。h:没有这样的文件或目录吗?

时间:2022-06-01 16:39:22

I need to rotate a Pixbuf. The vala code contains

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

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");
    }
}

The makefile contains

makefile包含

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

pkg -2.0 -pkg -2.0 -pkg -2.0 -pkg -pkg -- -pkg -pkg -pkg -pkg -pkg -pkg -pkg -pkg -pkg -pkg -pkg -- -pkg -pkg -pkg -pkg

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

不应该——pkg gtk+-3.0添加gdk-pixbuf/gdk-pixdata.h?

1 个解决方案

#1


1  

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:

Autotools将使用valac将Vala代码转换成C,然后使用它支持构建C来实际编译成机器码。这意味着您需要将相关信息添加到*_CFLAGS *_LDFLAGS中。通常,这是通过在您的配置中放置这样的东西来完成的。

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)

And something like this in Makefile.am:

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

#1


1  

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:

Autotools将使用valac将Vala代码转换成C,然后使用它支持构建C来实际编译成机器码。这意味着您需要将相关信息添加到*_CFLAGS *_LDFLAGS中。通常,这是通过在您的配置中放置这样的东西来完成的。

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)

And something like this in Makefile.am:

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