User forums > General (but related to Code::Blocks)
Compiling GTK+ Apps with CB
Dead1nside:
Hi,
Sorry if this is posted somewhere really obvious and I'm just being blind, but I'm having real trouble in getting C::B to compile programs built with code from the GTK+ 2.0 tutorial. http://www.gtk.org/tutorial/
This could be because I'm pretty new to all of this, but the lack of documentation or any guides to my knowledge is slightly disheartening.
Could someone guide me through it, if not point me in the right direction? I'm using CodeBlocks with MinGW 5.0.2 on Windows XP.
I have installed Glade and GTK using the most current installer from here http://gladewin32.sourceforge.net/modules/news/ .
I also tried following this guide http://www.ibiblio.org/apollo/WinGtkHowto.html and started dragging all the individual files into their respective directories in the c:\MinGw\ folder, but sorting through all those locale folders individually seems like I'm doing it the hard way.
Thanks in advance, would very much appreciate your time and help.
Dead1nside:
If I have it all installed, do I just need to put the paths to the gtk.h header file etc. if so where? Thanks, just trying to explain myself better.
MortenMacFly:
--- Quote from: Dead1nside on October 20, 2006, 08:19:08 pm ---if so where?
--- End quote ---
Basically yes: You need to provide the compiler with the include path to the GTK headers and the linker with the library patch to the GTK libraries. In addition you need to link your application against the GTK libraries that are required. This depends on your project.
All of this you setup in the project options under "Compiler" and "Linker".
With regards, Morten.
Dead1nside:
Thanks, I will try to get the format correct if not, I'll post back. Appreciate the reply.
Dead1nside:
Hi again,
I've just got round to this again, and I've forgotten what I need and where it needs to go. The include line goes like this
--- Code: (c) ---#include <gtk/gtk.h>
--- End code ---
So I've searched and I've got it installed in two places actually, but the one I should be using is in the "C:\MinGW\include\gtk-2.0\gtk" ?
So I added that to the Build Options of the project under Compiler--->[Other Options] but this gave me:
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
mingw32-gcc.exe: C:\MinGW\include\gtk-2.0\gtk: linker input file unused because linking not done
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
I'm stuck again, and would appreciate the help. I'm only really used to Delphi, even then I don't mess around with build options much. Thanks in advance.
Navigation
[0] Message Index
[#] Next page
Go to full version