using gtk+ and pixbuf

A

alternative451

hi

//my included files
#include<gdk/gdk.h>
#include<gdk/gdkx.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <gdk/gdkx.h>
#include<stdio.h>
a_fuction(){
GdkPixbuf *buf_pixel; // where i create a pixbuf object
}
main(){
}

//my gcc compilation line
gcc -lgdk_pixbuf-2.0 -lm main.c -o main `pkg-config --cflags --libs gtk
+`
// error
main.c:24: erreur: «GdkPixbuf» undeclared (first use in this function)
main.c:24: erreur: (Each undeclared identifier is reported only once
main.c:24: erreur: for each function it appears in.)
main.c:24: erreur: «buf_pixel» undeclared (first use in this function)


the gnome pixbuf section :
http://library.gnome.org/devel/gdk-pixbuf/stable/gdk-pixbuf-gdk-pixbuf.html
but if i include <gdk-pixbuf/gdk-pixbuf.h> gcc return no file found

I look for using a pixbuf object but i havent found how.
i don't know if it's a gcc option or in my code.

tanks
 
A

alternative451

prompt -> alternative451@sylvie-desktop:~/c$ pkg-config --print-errors
--cflags --libs gtk+

return -> -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/
glib/include -lgtk -lgdk -lXi -lXext -lX11 -lm -lglib
haaaaaaaaaaaaa
ok i think i need -lgdk_pixbuf
but how add ?

tank you
 
A

alternative451

Do you have gdk-pixbuf-config in your PATH? Try checking in /usr/X11R6/bin,

/usr/X11../bin checked -> there is a gdk-pixbuf-config

my path :
prompt -> alternative451@sylvie-desktop:~/c$ echo $PATH
return ->/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
usr/games


    `gdk-pixbuf-config --libs --cflags`

i added this line
prompt -> alternative451@sylvie-desktop:~/c$ gcc main.c -o main `pkg-
config --cflags --libs gtk+` `gdk-pixbuf-config --libs --cflags`

return some error
-> main.c:26: erreur: «GdkPixbuf» undeclared (first use in this
function)
 
A

alternative451

Ok
i had forgotten the include, now it's seems to be ok
tank you very mutch
 
C

CBFalconer

//my included files
#include<gdk/gdk.h>
#include<gdk/gdkx.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <gdk/gdkx.h>
#include<stdio.h>
a_fuction(){
GdkPixbuf *buf_pixel; // where i create a pixbuf object
}

This is entirely off-topic on c.l.c. The only standard includes in
the above list are stdlib.h and stdio.h.
 
R

Richard

CBFalconer said:
This is entirely off-topic on c.l.c. The only standard includes in
the above list are stdlib.h and stdio.h.

Does this mean posting code that contains any function that is not
defined in the standard is also off topic?
 
K

Kenny McCormack

Does this mean posting code that contains any function that is not
defined in the standard is also off topic?

Yes. But note that this assertion can be simplified to the following
simple statement (which I have proven to be true many times in the
past):

Nothing is on-topic in CLC. (*)

(*) Other than bitching and moaning about topicality. And, of course,
trolling.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top