Pelles C forum

Pelles C => General discussions => Topic started by: liut on June 24, 2013, 04:34:51 AM

Title: question about the path for "include" files
Post by: liut on June 24, 2013, 04:34:51 AM
Hi, I'm trying to study writing GTK+ programs under W32. But I meet a problem immediately. I have put the .h files under my project folder as this path: <project folder>\gtk\*.h, and set the code like this in the source: #include "gtk\gtk.h".

This is the error:
gtk\gtk.h(32): fatal error #1035: Can't find include file <gdk/gdk.h>

The source codes in the head file like this:
#include <gdk/gdk.h>
#include <gtk/gtkaboutdialog.h>
#include <gtk/gtkaccelgroup.h>
#include <gtk/gtkaccellabel.h>
#include <gtk/gtkaccelmap.h>
...

I don't want to change 'path symbol' in all these head files from 'slash' to 'backslash'. So is there a switch in options or properties to let Pelles C accept such unix-style path?
Title: Re: question about the path for "include" files
Post by: TimoVJL on June 24, 2013, 06:10:07 AM
in poide you should insert gtk include paths to Project options... -> Folders -> Include like that your project folder and possible folders like cairo too.
Title: Re: question about the path for "include" files
Post by: liut on June 24, 2013, 07:22:37 AM
Thanks for your reply! I think it was my fault. I didn't put all head files into my project folder. I'm still fighting with the head files yet...
Title: Re: question about the path for "include" files
Post by: frankie on June 24, 2013, 09:54:32 AM
And moreover PellesC treats slash and backslash in same way (so *nix style is accepted)...
Title: Re: question about the path for "include" files
Post by: liut on June 24, 2013, 11:28:29 AM
Thanks! I found it too... After testing hundreds times and set a lot of folders / libs / dlls, the hello-world window for gtk+ can show up now ;D
Title: Re: question about the path for "include" files
Post by: TimoVJL on June 24, 2013, 03:03:09 PM
Pelles C and GTK Quick Start Tutorial here (http://forum.pellesc.de/index.php?topic=4713.msg18148#msg18148)

some tests using gtk directory.
include directories used:
..\..\gtk-2.24.10\include;
..\..\gtk-2.24.10\include\gtk-2.0;
..\..\gtk-2.24.10\include\glib-2.0;
..\..\gtk-2.24.10\lib\glib-2.0\include;
..\..\gtk-2.24.10\include\gio-win32-2.0;
..\..\gtk-2.24.10\include\cairo;
..\..\gtk-2.24.10\include\pango-1.0;
..\..\gtk-2.24.10\lib\gtk-2.0\include;
..\..\gtk-2.24.10\include\gdk-pixbuf-2.0;
..\..\gtk-2.24.10\include\atk-1.0
directory tree example
c:\code\gtk-2.24.10\
                   \bin\
                   \lib\
                   \include\

project dir:
c:\code\PellesC\GTKTest\
in project file
POC_PROJECT_WORKPATH = ..\..\gtk-2.24.10\bin#

INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include;..\..\gtk-2.24.10\include;..\..\gtk-2.24.10\include\gtk-2.0;..\..\gtk-2.24.10\include\glib-2.0;..\..\gtk-2.24.10\lib\glib-2.0\include;..\..\gtk-2.24.10\include\gio-win32-2.0;..\..\gtk-2.24.10\include\cairo;..\..\gtk-2.24.10\include\pango-1.0;..\..\gtk-2.24.10\lib\gtk-2.0\include;..\..\gtk-2.24.10\include\gdk-pixbuf-2.0;..\..\gtk-2.24.10\include\atk-1.0#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib;..\..\gtk-2.24.10\lib#

Title: Re: question about the path for "include" files
Post by: liut on June 25, 2013, 03:30:54 AM
Yes. The working environment I setup and tested is very similar with the guideline written by rweidner. If I saw it before, I think I could save some time... 8)