User forums > General (but related to Code::Blocks)

How to Configure Code::Blocks GTK MinGW Project

<< < (2/3) > >>

codecub:

--- Quote from: stahta01 on October 16, 2013, 06:12:41 pm ---
--- Quote from: kvn on October 16, 2013, 04:56:56 pm ---thanks but i am getting a lot of errors after i build sample program...

--- End quote ---
...
--- End quote ---

@stahta01: Hopefully you, or somebody in the knowledge, is still watching. Here are my error messages, please help:


--- Code: ----------------- Build: Debug in gtkCodelocks01 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\gtk\lib -o bin\Debug\gtkCodelocks01.exe obj\Debug\main.o  -LC:/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl   
obj\Debug\main.o: In function `helloWorld':
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:8: undefined reference to `gtk_window_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:8: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:8: undefined reference to `gtk_message_dialog_new'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:9: undefined reference to `gtk_window_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:9: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:9: undefined reference to `gtk_window_set_position'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:10: undefined reference to `gtk_dialog_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:10: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:10: undefined reference to `gtk_dialog_run'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:11: undefined reference to `gtk_widget_destroy'
obj\Debug\main.o: In function `main':
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:21: undefined reference to `gtk_false'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:21: undefined reference to `g_log_set_handler'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:22: undefined reference to `gtk_init_abi_check'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:23: undefined reference to `g_log_default_handler'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:23: undefined reference to `g_log_set_handler'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:26: undefined reference to `gtk_window_new'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:27: undefined reference to `gtk_container_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:27: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:27: undefined reference to `gtk_container_set_border_width'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:28: undefined reference to `gtk_window_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:28: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:28: undefined reference to `gtk_window_set_title'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:29: undefined reference to `gtk_window_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:29: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:29: undefined reference to `gtk_window_set_position'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:30: undefined reference to `gtk_widget_realize'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:31: undefined reference to `gtk_main_quit'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:31: undefined reference to `g_signal_connect_data'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:34: undefined reference to `gtk_vbox_new'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:35: undefined reference to `gtk_container_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:35: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:35: undefined reference to `gtk_container_add'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:37: undefined reference to `gtk_button_new_from_stock'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:38: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:38: undefined reference to `g_signal_connect_data'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:39: undefined reference to `gtk_box_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:39: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:39: undefined reference to `gtk_box_pack_start'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:41: undefined reference to `gtk_button_new_from_stock'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:42: undefined reference to `gtk_main_quit'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:42: undefined reference to `g_signal_connect_data'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:43: undefined reference to `gtk_box_get_type'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:43: undefined reference to `g_type_check_instance_cast'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:43: undefined reference to `gtk_box_pack_start'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:46: undefined reference to `gtk_widget_show_all'
G:/User/bue/Desktop/GTK/gtkCodelocks01/main.c:47: undefined reference to `gtk_main'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
46 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---

Hi, I am a Code::Blocks newbie. Just followed your instructions here. I use Windows 8 64bit, CodeBlocks 13.12, from: codeblocks-13.12mingw-setup.exe and  GTK from gtk+-bundle_2.16.6-20100208_win64.zip. I used used CB Wizard to create the GTK sample project.

Why do I get these error messages? And what can I do about it?

Thanks,

codecub

P.S. I have no problem with the same program and Code::Blocks on Ubuntu 12.04 64 bit.  And on Windows 8, I can comnpile and run this program (the main.c file) correctly in Cygwin's Xserver-Window.

oBFusCATed:
You're not linking the gtk library, -lgtk is missing from the linker's command line.

stahta01:

--- Quote from: codecub on January 04, 2014, 07:39:04 pm ---
@stahta01: Hopefully you, or somebody in the knowledge, is still watching. Here are my error messages, please help:


Hi, I am a Code::Blocks newbie. Just followed your instructions here. I use Windows 8 64bit, CodeBlocks 13.12, from: codeblocks-13.12mingw-setup.exe and  GTK from gtk+-bundle_2.16.6-20100208_win64.zip. I used used CB Wizard to create the GTK sample project.

Why do I get these error messages? And what can I do about it?

Thanks,

codecub

P.S. I have no problem with the same program and Code::Blocks on Ubuntu 12.04 64 bit.  And on Windows 8, I can comnpile and run this program (the main.c file) correctly in Cygwin's Xserver-Window.



--- End quote ---

FYI: The Compiler shipped with Code::Blocks is a 32-bit only Compiler!

Is there any reason you think gtk+-bundle_2.16.6-20100208_win64.zip will work with it?

Tim S.

codecub:

--- Quote from: stahta01 on January 04, 2014, 10:24:02 pm ---...
FYI: The Compiler shipped with Code::Blocks is a 32-bit only Compiler!

Is there any reason you think gtk+-bundle_2.16.6-20100208_win64.zip will work with it?

Tim S.


--- End quote ---
Thanks, Tim, for guiding a 32/64bit dumbhead! Just replaced  gtk+-bundle_2.16.6-20100208_win64.zip with gtk+-bundle_2.24.10-20120208_win32.zip, and Code::Blocks does GTK like a genie  :)

P.S. I saved your Code::Block modifications in Project > Build options; could I do it permanently in Settings > Compiler without harming future non-GTK projects? This would spare me to do the modifications over and over in each new GTK project.

Siggi

Jenna:
You can create a stub gtk-project and do the setup so it fits your needs, and then save it as user template ("File -> Save project as user template")  and reuse it via "File -> New -> From template" .

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version