Re: Very simple gdk-pixbuf question/new to programming
- From: "Maher Awamy" <muhri muhri net>
- To: "Morten B. Pedersen" <morten wtf dk>, gtk-app-devel-list gnome org
- Subject: Re: Very simple gdk-pixbuf question/new to programming
- Date: 12 Oct 2000 02:45:17 CDT
you will want to do this
g++ -o test main.cpp `gtk-config --cflags --libs` `gdk-pixbuf-config --cflags
--libs`
so that it links gtk libs and gdk pixbuf libs to find the functions
Maher
On Wed, 11 Oct 2000 12:14:26 +0200, Morten B. Pedersen said:
Hi,
I'm very new to programming in C/C++ - but I just wanted to try playing
around with gdk-pixbuf.
Sorry if this question is unrelated to the mailing list.
When I compile my source, I get:
$ g++ main.cpp
/tmp/ccdZSqAL.o: In function `main':
/tmp/ccdZSqAL.o(.text+0xf): undefined reference to `gdk_pixbuf_new_from_file'
/tmp/ccdZSqAL.o(.text+0x27): undefined reference to `gdk_pixbuf_get_width'
/tmp/ccdZSqAL.o(.text+0x3d): undefined reference to `gdk_pixbuf_get_height'
collect2: ld returned 1 exit status
I don't understand why this happens, because I have:
#include <gtk/gtk.h> and
#include <gdk-pixbuf/gdk-pixbuf.h>
Shouldn't this work then?
My whole source code below (I know, it doesn't do anything really):
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iomanip.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#define IMAGE_NAME "background.jpg"
int main(int argc)
{
int back_width, back_height;
static GdkPixbuf *background;
background = gdk_pixbuf_new_from_file (IMAGE_NAME);
back_width = gdk_pixbuf_get_width (background);
back_height = gdk_pixbuf_get_height (background);
}
Thanks for your time.
--
Med venlig hilsen - Sincerely
Morten B. Pedersen - morten wtf dk
Copenhagen, Denmark.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
muhri muhri net -- http://www.muhri.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]