complie error

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

 



Hello all
   I encountered a simple problem while compile a
simple program
    the program and the complie infomation as follow
/**************************************************/
#include<gtk/gtk.h>
int main (int argc, char **argv)
{
  GtkWidget *window;

  /* init threads */	
  g_thread_init(NULL);
  gdk_threads_init();
  
  /* init gtk */
  gtk_init(&argc, &argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_widget_show(window);

  gdk_threads_enter();
  gtk_main();
  gdk_threads_leave();

  return 0;
}
/*************************************************/
and the complier told  me that
/*-----------------------------------------------*/
/tmp/cc1s1xqZ.o(.text+0x16): In function `main':
: undefined reference to `g_thread_init'
collect2: ld returned 1 exit status
/*-----------------------------------------------*/

I do not know what's wrrong in my program
when i delete the g_thread_init function from my
program,
   it will complie succesfully
but when i run the object file
 it failed
Can anybody help me?
Thanks in advance!


__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux