Follow the following step to setup GTK project in Code::Blocks (windows 7)
step 1: Download gtk+-bundle_2.24.10-20120208_win32.zip (all-in-one bundle) from http://www.gtk.org/download/win32.php
step 2: Extract it in c drive creating new directory or any other place. In my case C:\GTK is the directory where I extracted the zip file.
My extracted files looks like below.
Give project name "GTKsample" or give name of your choice. And click next.
Give path C:\GTK for GTK location where you extracted the zip file. And click Next.
And click Finish.
After creating gtk project you will see the sample program then build project, build must be successful.
step 4: This is last step, upto step 3 build project must be successful. When you try to run the project you will get message something .dll file (runtime library) missing like below image because we haven't given path for runtime library(.dll file).
For this goto the C:\GTK directories where you extracted the zip file. Open the bin folder only copy all the .dll file and paste it in your project directory GTKsample\bin\Debug\ with project executable file.
In this method every time you create the project you have to keep all the .dll file with project executable file i.e (inside project \bin\Debug\ folder). If you don't want this then copy and paste all the .dll file from bin folder to C:\windows\system32 directory.
If you completed the step 4 then the project. You must have successfully running project like below image.
Finally if you see the successfully running project like above image then you became successful to setup GTK project in Code::Blocks. If any problem occurs please comment below.
Nice post. I was stuck with this. Helps me a lot. Thank u very much for this really helpful post.
ReplyDeleteeveryone fuck
DeleteI get "the path you entered seems valid but this wizard cann't locate the following GTK's include file: gtk.h in it
ReplyDeleteYou need to use GTK+ 2 as it doesn't work on GTK+ 3
Deletecan't
ReplyDeleteI get "the path you entered seems valid but this wizard cann't locate the following GTK's include file: gtk.h in it.
ReplyDeleteWhat is that? :(
i had the same issue, it seems to be the GTK version, i try with GTK+ 3.6.4 (http://win32builder.gnome.org/gtk+-bundle_3.6.4-20130921_win32.zip) and got that error
Deletebut with GTK+ 2.24 (http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip) i finally get things going
Yes, same error gtk 3.6.4.
ReplyDeleteOf course, there is no solution to it.
Typical problem with these backyard 'open source' projects.
Now get Visual Studio.
Is there any way I can pack the .dll with the .exe? It's a pain if I have to send my "hello world" app to others with so many files!!
ReplyDeleteThank you very much for help that worked for the GTK+ error ( "the path you entered seems valid but this wizard cann't locate the following GTK's include file: gtk.h in it.) THANKS MORPHEUS
ReplyDeleteGo in “C:\Program Files\CodeBlocks\share\CodeBlocks\templates\wizard\gtk”
ReplyDeleteEdit (with admin right) the wizard.script file.
Look for these lines:
line 57 : if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("gtk-2.0") + wxFILE_SEP_PATH +_T("gtk"), _T("gtk.h"), _T("GTK's include")))
line 64 : if (!VerifyLibFile(dir_nomacro_lib, _T("gtk-win32-2.0"), _T("GTK's")))
line 116 : project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("gtk-2.0"));
line 123 : project.AddIncludeDir(GtkPathDefaultLib + wxFILE_SEP_PATH + _T("gtk-2.0") + wxFILE_SEP_PATH + _T("include"));
line 131 : project.AddLinkLib(_T("gtk-win32-2.0"));
and change them like that:
if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("gtk-3.0") + wxFILE_SEP_PATH +_T("gtk"), _T("gtk.h"), _T("GTK's include")))
if (!VerifyLibFile(dir_nomacro_lib, _T("gtk-win32-3.0"), _T("GTK's")))
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("gtk-3.0"));
project.AddIncludeDir(GtkPathDefaultLib + wxFILE_SEP_PATH + _T("gtk-3.0") + wxFILE_SEP_PATH + _T("include"));
project.AddLinkLib(_T("gtk-win32-3.0"));
Sean paul Thanks, it works correctly
DeleteStep 1 to 3 is same.
ReplyDeleteBut " Give path C:\GTK ..." have problem
https://plus.google.com/photos/111096088877369101815/albums/6128727852683689825/6128727857432518818
How can I do?
I know whats happen, before I have download GTK3, Now I use GTK2, is OK!
Deletesk - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
ReplyDeleteNothing to be done.
Thanks a lot man !!! Excellent job !!
ReplyDeleteThanks a lot man !!! Excellent job !!
ReplyDeleteTime danger location and infection evacuation are the most looked for after components in any antivirus programming. This is innate normal for any item made accessible through us.https://how-to-remove.org/malware/browser-hijacker-removal/chjicha-club-removal/
ReplyDelete