undefined reference to g_set_error_handler



Dear ,
 
I am new with GTK+ . I have a simple code but it gives compilation error. Can any one tell me what I am doing wrong
The code :
 
 
#include <glib.h>
 
void SurferPrint(const gchar *buf)
{
printf("Dude ,");
printf(buf);
}
 
void SurferMessage(const gchar *buf)
{
printf("Dude, ya got a message . ");
printf(buf);
}
void SurferWarning(const gchar *buf)
{
printf("Bad news Dude .");
printf(buf);
}
void SurferError(const gchar *buf)
{
printf("Major wipe out, dude ..");
printf(buf);
}
void ShowParams()
{
printf("Must pass in parameter. Valid parameters are: \n");
printf("'surfer' - use surfer message handling.\n");
printf("'normal'- use normal message handling. \n");
exit(0);
}
int main(int argc, char * argv[])
{
if (argc <=1)
{
ShowParams();
}
if(strcmp(argv[1],"normal") == 0)
{ printf("Hello Wait For The Flower To Bloom\n"); }
else if(strcmp(argv[1],"surfer")==0)
{
g_set_error_handler(SurferError);
else
{
ShowParams();
}
g_error("here Is An Erro\n");
}

 

after : > gcc prog1.c -o prog1 `gtk -config --cflags --libs`

The error is :

>>undefined reference to g_set_error_handler
>>undefined reference to g_log

 

Waiting for your reply.

 

Iftekhar

 

 



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