Which Library Files for these unreferenced functions?

This is a discussion on Which Library Files for these unreferenced functions? within the C++ Programming forums, part of the General Programming Boards category; Hi, I got the following error while building my project. I was wondering which library files I should specify to ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    159

    Which Library Files for these unreferenced functions?

    Hi,
    I got the following error while building my project. I was wondering which library files I should specify to my project? Generally how can one know which library file for a given unreferenced function? Thanks in advance!

    /home/ting/opencv/helloworld_linux/main.c||In function ‘main’:|
    /home/ting/opencv/helloworld_linux/main.c|15|warning: unused variable ‘text_size’|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0x7a)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0xcd)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0xe2)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0xf9)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0x102)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `icvOnKeyPress(_GtkWidget*, _GdkEventKey*, void*)':|
    (.text+0x11d)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x189)||undefined reference to `g_timeout_add'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x1a1)||undefined reference to `gtk_main_iteration_do'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x1ec)||undefined reference to `g_source_remove'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x1f9)||undefined reference to `g_thread_self'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x216)||undefined reference to `g_get_current_time'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x228)||undefined reference to `g_time_val_add'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x22e)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x259)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x26a)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x2b7)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvWaitKey':|
    (.text+0x2e4)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x614)||undefined reference to `gtk_range_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x623)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x632)||undefined reference to `gtk_range_set_value'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x689)||undefined reference to `g_thread_self'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x699)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x6b0)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x6c1)||undefined reference to `g_thread_self'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x6d5)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvSetTrackbarPos':|
    (.text+0x6f0)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x7c5)||undefined reference to `gtk_range_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x7d7)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x7e6)||undefined reference to `gtk_range_set_value'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x806)||undefined reference to `gtk_object_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x815)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x855)||undefined reference to `gtk_signal_connect_full'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x85a)||undefined reference to `gtk_widget_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x86c)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x874)||undefined reference to `gtk_widget_queue_resize'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x929)||undefined reference to `g_thread_self'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x93d)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x958)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x971)||undefined reference to `g_thread_self'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x985)||undefined reference to `g_threads_got_initialized'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0x9a0)||undefined reference to `g_thread_functions_for_glib_use'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa31)||undefined reference to `gtk_hbox_new'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa3c)||undefined reference to `gtk_label_new'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa56)||undefined reference to `gtk_hscale_new_with_range'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa5e)||undefined reference to `gtk_range_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa6d)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa7d)||undefined reference to `gtk_range_set_update_policy'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa82)||undefined reference to `gtk_scale_get_type'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xa93)||undefined reference to `g_type_check_instance_cast'|
    /usr/lib/libhighgui.a(window_gtk.o)||In function `cvCreateTrackbar':|
    (.text+0xaa3)||undefined reference to `gtk_scale_set_digits'|
    ||More errors follow but not being shown.|
    ||Edit the max errors limit in compiler options...|
    ||=== Build finished: 50 errors, 1 warnings ===|

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    I would suggest your gtk documentation.

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    159
    Thanks.
    I am searching in GTK's document but kind of lost. Which part of a library's document will give info on its library files?

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,673
    The opencv wiki was useless, but I found a list of dependencies here: http://packages.ubuntu.com/dapper/libhighgui-dev

    gg

  5. #5
    Registered User
    Join Date
    May 2011
    Location
    Westport, Massachusetts, United States
    Posts
    1

    gobject-2.0

    -lgobject-2.0 did it for me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble passing args to functions in other files
    By Midnight Coder in forum C Programming
    Replies: 6
    Last Post: 01-03-2009, 04:13 PM
  2. Passing functions between files
    By Duskan in forum C Programming
    Replies: 9
    Last Post: 04-17-2007, 07:44 AM
  3. C++ standard library functions
    By eno in forum C++ Programming
    Replies: 1
    Last Post: 12-16-2003, 09:15 PM
  4. better c string functions
    By samps005 in forum C Programming
    Replies: 8
    Last Post: 11-04-2003, 12:28 PM
  5. functions & external files
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 10-24-2001, 03:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21