User forums > Using Code::Blocks
linking GTK with codeblocks?
MortenMacFly:
--- Quote from: stahta01 on January 06, 2016, 07:43:07 pm ---The MSys2 GTK3 Packages I added; I added all of gtk3 recommend packages.
Patch file of the changes I needed to do to CB GTK Wizard; to make it work with GTK3 and Code::Blocks 13.12.
--- End quote ---
That can only be an interim-patch. Better would be to support both version by lettings the user choose.
stahta01:
--- Quote from: MortenMacFly on January 07, 2016, 11:01:08 am ---
--- Quote from: stahta01 on January 06, 2016, 07:43:07 pm ---The MSys2 GTK3 Packages I added; I added all of gtk3 recommend packages.
Patch file of the changes I needed to do to CB GTK Wizard; to make it work with GTK3 and Code::Blocks 13.12.
--- End quote ---
That can only be an interim-patch. Better would be to support both version by lettings the user choose.
--- End quote ---
I agree; but, the OP needed it before I will have time to add the GUI choice. I am still not very good at the Scripting code changes esp. when it requires GUI stuff. But, it sounds like the OP has stopped using MSys2; so, I will likely give up helping because I decided that getting MSys2 and Code::Blocks working is what I am trying to get done right now. Will post a patch as I think is needed for GTK2/3 and MSys2 compiler in the future. After that, I plan to work on SDL1/2 CB Wizard and MSys2 patch.
Tim S.
southernsontn:
--- Quote from: oBFusCATed on January 07, 2016, 08:19:22 am ---Can you record a video of this behaviour?
--- End quote ---
I can probably get some screenshots, but that's about the best I can do. I don't have any sort of video capture software on my laptop.
edit: I went in to try to get the screenshots, and the behavior isn't replicating today.
As it stands, I can get a blank window to open from the tutorial code from the gtk website: http://www.gtk.org/tutorial1.2/gtk_tut-2.html
(I posted the link to the location where I got the code rather than post the code itself to save space. I copy/pasted the code verbatim fro that tutorial
When working on the hello world sample on the same page, I get 17 errors and 4 warnings:
--- Code: ---||=== Build: Debug in newgtk (compiler: GNU GCC Compiler) ===|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c||In function 'main':|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|57|warning: implicit declaration of function 'gtk_signal_connect' [-Wimplicit-function-declaration]|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|57|warning: implicit declaration of function 'GTK_OBJECT' [-Wimplicit-function-declaration]|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|58|warning: implicit declaration of function 'GTK_SIGNAL_FUNC' [-Wimplicit-function-declaration]|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|81|warning: implicit declaration of function 'gtk_signal_connect_object' [-Wimplicit-function-declaration]|
obj\Debug\main.o||In function `hello':|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|10|undefined reference to `g_print'|
obj\Debug\main.o||In function `delete_event':|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|23|undefined reference to `g_print'|
obj\Debug\main.o||In function `main':|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|57|undefined reference to `GTK_SIGNAL_FUNC'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|57|undefined reference to `GTK_OBJECT'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|57|undefined reference to `gtk_signal_connect'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|63|undefined reference to `GTK_SIGNAL_FUNC'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|63|undefined reference to `GTK_OBJECT'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|63|undefined reference to `gtk_signal_connect'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|67|undefined reference to `g_type_check_instance_cast'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|75|undefined reference to `GTK_SIGNAL_FUNC'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|75|undefined reference to `GTK_OBJECT'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|75|undefined reference to `gtk_signal_connect'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|81|undefined reference to `GTK_OBJECT'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|81|undefined reference to `GTK_SIGNAL_FUNC'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|81|undefined reference to `GTK_OBJECT'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|81|undefined reference to `gtk_signal_connect_object'|
C:\Users\Will\Documents\learning\C++\misc\newgtk\main.c|86|undefined reference to `g_type_check_instance_cast'|
||=== Build failed: 17 error(s), 4 warning(s) (0 minute(s), 1 second(s)) ===|
--- End code ---
While I'm not exactly an expert with GTK+, I do know that the g_print() function is a part of the Glib library (Glib is a dependency of GTK). I added an include for glib.h, and it still came up the same .
stahta01:
If you wish to use GTK3 then find a better sample code.
You can NOT expect several year old code to work with GTK3; it did work for me with GTK2 and MSys2.
Edit: I am guessing the "tutorial1.2" means it was written for GTK1.2.
Edit2: Learn how to create a full rebuild log; this will be needed when you seek help on a site that supports GTK3.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Edit3: Link to some directions I am working on for GTK3 and MSys2
https://github.com/stahta01/cb_misc/blob/master/Notes/MSys2/Setting%20up%20MSys2%20for%20using%20GTK3%20with%20external%20CodeBlocks%20IDE.txt
Tim S.
stahta01:
Patch that I plan to test more in the future; but, I plan to change more CB Wizards before doing that testing.
Tim S.
Deleted patch; Will post patches in a new thread when I finish testing them.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version