NO

Author Topic: question about the path for "include" files  (Read 6362 times)

liut

  • Guest
question about the path for "include" files
« 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?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2118
Re: question about the path for "include" files
« Reply #1 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.
May the source be with you

liut

  • Guest
Re: question about the path for "include" files
« Reply #2 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...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: question about the path for "include" files
« Reply #3 on: June 24, 2013, 09:54:32 AM »
And moreover PellesC treats slash and backslash in same way (so *nix style is accepted)...
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

liut

  • Guest
Re: question about the path for "include" files
« Reply #4 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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2118
Re: question about the path for "include" files
« Reply #5 on: June 24, 2013, 03:03:09 PM »
Pelles C and GTK Quick Start Tutorial here

some tests using gtk directory.
include directories used:
Code: [Select]
..\..\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
Code: [Select]
c:\code\gtk-2.24.10\
                   \bin\
                   \lib\
                   \include\

project dir:
c:\code\PellesC\GTKTest\
in project file
Code: [Select]
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#
« Last Edit: June 24, 2013, 05:10:01 PM by timovjl »
May the source be with you

liut

  • Guest
Re: question about the path for "include" files
« Reply #6 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)