Thread: GTK+ fails to install

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    3

    GTK+ fails to install

    Ubuntu 11.04
    Code::Blocks 10.05

    Installed codeblocks and GTK using synaptic. Opened a GTK template project and it failed to compile. Problem is that GTK when installing doesnt register its include paths with codeblocks, and codeblocks seems oblivious to newly installed libraries.

    Other than adding dozens of additional include and link paths to the settings, is there a way to get codeblocks to recognize the GTK libraries. I'm assuming it will have this issue with every other library I install, such as libwebcam etc. and i really dont want to have to manually add, in addition to guessing what to add, every new path.
    Last edited by Aria; 08-19-2011 at 05:04 PM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Sad to say, but that's kinda the way it works... Do it right and you only have to do it once...

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    3
    Quote Originally Posted by CommonTater View Post
    Sad to say, but that's kinda the way it works... Do it right and you only have to do it once...
    Only under linux apparently. I'm beginning to see why Microsoft can hold market share against a free OS
    Code:
    obj/Release/main.o||In function `helloWorld':|
    main.c|| undefined reference to `gtk_window_get_type'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_message_dialog_new'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_window_set_position'|
    main.c|| undefined reference to `gtk_dialog_get_type'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_dialog_run'|
    obj/Release/main.o||In function `main':|
    main.c|| undefined reference to `gtk_false'|
    main.c|| undefined reference to `g_log_set_handler'|
    main.c|| undefined reference to `gtk_init'|
    main.c|| undefined reference to `g_log_default_handler'|
    main.c|| undefined reference to `g_log_set_handler'|
    main.c|| undefined reference to `gtk_window_new'|
    main.c|| undefined reference to `gtk_container_get_type'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_container_set_border_width'|
    main.c|| undefined reference to `gtk_window_get_type'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_window_set_title'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_window_set_position'|
    main.c|| undefined reference to `gtk_widget_realize'|
    main.c|| undefined reference to `gtk_main_quit'|
    main.c|| undefined reference to `g_signal_connect_data'|
    main.c|| undefined reference to `gtk_vbox_new'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_container_add'|
    main.c|| undefined reference to `gtk_button_new_from_stock'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `g_signal_connect_data'|
    main.c|| undefined reference to `gtk_box_get_type'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_box_pack_start'|
    main.c|| undefined reference to `gtk_button_new_from_stock'|
    main.c|| undefined reference to `gtk_main_quit'|
    main.c|| undefined reference to `g_signal_connect_data'|
    main.c|| undefined reference to `g_type_check_instance_cast'|
    main.c|| undefined reference to `gtk_box_pack_start'|
    main.c|| undefined reference to `gtk_widget_show_all'|
    main.c|| undefined reference to `gtk_main'|
    obj/Release/main.o||In function `helloWorld':|
    main.c|| undefined reference to `gtk_widget_destroy'|
    ||=== Build finished: 42 errors, 0 warnings ===|
    Last edited by Aria; 08-19-2011 at 05:22 PM.

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Not having used Code::Blocks before.. But one would think it should be possible to get it to use gtk-config or pkg-config to avoid having to add paths and libraries manually?
    And visual studio isn't any different. You still have to add search paths and libraries yourself most of the time.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by _Mike View Post
    Not having used Code::Blocks before.. But one would think it should be possible to get it to use gtk-config or pkg-config to avoid having to add paths and libraries manually?
    And visual studio isn't any different. You still have to add search paths and libraries yourself most of the time.
    Yes, this is possible to do under Code::Blocks/Linux for wxWidgets; so, it should work for GTK.

    Closest directions I could find. NOTE: You must use the correct tick marks.
    http://wiki.codeblocks.org/index.php...n_Code::Blocks

    Tim S.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fscanf fails on an int
    By Chronoflect in forum C Programming
    Replies: 3
    Last Post: 02-18-2011, 06:00 PM
  2. Why this fails?
    By manav in forum C++ Programming
    Replies: 13
    Last Post: 05-29-2008, 01:11 PM
  3. trying to rea from /dev/tty fails!
    By arunj in forum Linux Programming
    Replies: 4
    Last Post: 10-17-2007, 03:59 AM
  4. accept() fails
    By Desolation in forum Networking/Device Communication
    Replies: 3
    Last Post: 05-16-2006, 07:37 AM
  5. WIndows Install Fails...
    By frednick in forum Windows Programming
    Replies: 1
    Last Post: 01-31-2003, 01:23 PM