Error F0029 Can't open #include file '..\myfile.def'

361 views
Skip to first unread message

Faby

unread,
Mar 15, 2014, 7:48:33 AM3/15/14
to harbou...@googlegroups.com
Hello,

in clipper I have
#include "..\myfile.def"

in harbour I get
Error F0029 Can't open #include file '..\myfile.def'

I change to
#include ".\myfile.def"
and work fine but How I can to do for have a same line for clipper and harbour ?

I want not add
#ifndef HARBOUR
#include "..\myfile.def"
#endif
#ifdef HARBOUR
#include ".\myfile.def"
#endif

for example this not work

#define _dir ".\"
#include _dir + "myfile.def"

Thank you
Fabian

Klas Engwall

unread,
Mar 15, 2014, 8:58:36 AM3/15/14
to harbou...@googlegroups.com
Hi Faby,

> in clipper I have
> #include "..\myfile.def"
>
> in harbour I get
> Error F0029 Can't open #include file '..\myfile.def'
>
> I change to
> #include ".\myfile.def"
> and work fine but How I can to do for have a same line for clipper and
> harbour ?

But those are two different locations. Where is the file located in
relation to the working directory?

Harbour supports all kinds of path specifications like ...

#include "filename.ext" // Here
#include ".\filename.ext" // Also here
#include "..\filename.ext" // Parent directory
#include "..\parallelldirectory\filename.ext"
// as well as
#include "filename.ext" // Any other directory if
-i<p> // (where <p> is the path) or
-incpath=<p> // is specified in the .hbp

Regards,
Klas

Faby

unread,
Mar 15, 2014, 9:25:14 AM3/15/14
to harbou...@googlegroups.com
in the Parent directory

Klas Engwall

unread,
Mar 15, 2014, 9:59:16 AM3/15/14
to harbou...@googlegroups.com
Hi Faby,

> in the Parent directory

But then ...

> I change to
>#include ".\myfile.def"

... cannot possibly solve the problem. There is something else going on
that you have not told us yet.

Regards,
Klas

Faby

unread,
Mar 16, 2014, 2:36:25 AM3/16/14
to harbou...@googlegroups.com
Thank you Klas,

I uploaded an example of my problem

TestFolder.zip

Klas Engwall

unread,
Mar 16, 2014, 4:20:11 PM3/16/14
to harbou...@googlegroups.com
Hi Faby,

> I uploaded an example of my problem

OK, now I can see what you are doing. The easiest way to reference
header files that are not located in the same directory as the .prg file
where it is #include(d) is to use the -i option in Harbour and the SET
INCLUDE environment variable in Clipper

In the Harbour .hbp file: -i\thepathto\testfolder
In the Clipper setup: SET INCLUDE=\thepathto\testfolder

And then remove the path from the #include directive.

Regards,
Klas

Faby

unread,
Mar 16, 2014, 7:53:14 PM3/16/14
to harbou...@googlegroups.com
Thank you klas


> In the Harbour .hbp file: -i\thepathto\testfolder

with this I have the problem that I have some folders with the equal file name inside
and harbour and clipper then get the first found

any other idea are welcome

Thank you

Faby

unread,
Mar 17, 2014, 11:17:55 AM3/17/14
to harbou...@googlegroups.com
the problem is with the mainfolder of the program

solution

In clipper I added /iD:\mymainfolder    in the .rmk
and change "..\file.def" to  ".\file.def"

the others file for example
#include "..\subfolder\file2.def"    chage to    #include ".\subfolder\file2.def"
this work fine in clipper and Harbour

Thank you

Reply all
Reply to author
Forward
0 new messages