Re: why error?



laibinqiang wrote:

l> Dear Sir:

Hi,

l>      I am a new user of gtk,I writed the following code yesterday

[cut]

l>     But when I compiled this code the following error message appears

l>    gtk_init() undefined.....
l>    gtk_widget_show() undefined.....
l>    gtk_main() undefined......

l>    I did include the head file gtk.h in ,Can you Please tell me why these
l> happend
l> and how can I do.....

It  looks  like  you didn't linked your "app" to Gtk+. You must do it,
otherway  the binary won't be able to find the Gtk+ functions you use.
It   the  same  problem  you have when you use the sqrt and don't link
your  program  to libm. The gtk-config binary is the way to solve this
problem. Your command line should be like:

gcc test.c -o test `gtk-config --libs --cflags`

(if  you  don't  have  the  `  caracter  in  your  keyword you can use
$(gtk-config --libs --cflags) instead).

Hope you will understand my bad english,

l>                                                           yours pekky.nice
l>                                                           tianjin university
l>                                                            P.R.CHINA





l> --http://www.eyou.com
l> --Îȶ¨¿É¿¿µÄÃâ·Ñµç×ÓÐÅÏä  ÓïÒôÓʼþ  Òƶ¯ÊéÇ©  ÈÕÀú·þÎñ...ÒÚÓÊδ¾¡
Oh, that's a nice sig for an english ML :)


--
mmenal
                                 ____               _    _                    _
         __  __ _ __  __  __    / ___| ___  _   _  | |  ( )_ __  _   ___  __ | |
(o-      \ \/ /(_)\ \/ /  _ \  | |  _ /'_ \| | | | | |  | | '_ \| | | \ \/ / | |
/\        \  / | | \  / | __/  | |_| | | | | |_| | | |__| | | | | |_| |>  <  |_|
L_/_       \/  |_|  \/  \___|  \_____|_| |_|\__,_/ |____|_|_| |_|\__,_/_/\_\ (_)


 
______________________________________________________________________________
Vous avez un site perso ?
2 millions de francs à gagner sur i(france) !
Webmasters : ZE CONCOURS ! http://www.ifrance.com/_reloc/concours.emailif






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]