IonicWind Software

IWBasic => General Questions => Topic started by: Hootie on October 24, 2008, 08:28:56 PM

Title: Relative Paths for $INCLUDE
Post by: Hootie on October 24, 2008, 08:28:56 PM
I have a source file in \main directory.  I have an .inc file in \log directory.  Both directories are under the same parent directory so they are on the same directory level. I am trying to use a relative path to include the .inc file into the source file in \main as follows:


$INCLUDE "..\log\amLog.inc"


The compiler says it is unable to open the file. Are relative paths not supported?
Title: Re: Relative Paths for $INCLUDE
Post by: Ionic Wind Support Team on October 24, 2008, 08:49:22 PM
Yes they are supported, I use them all of the time.  Are you using a project?

Title: Re: Relative Paths for $INCLUDE
Post by: Hootie on October 24, 2008, 08:54:41 PM
Yes, both main.eba and amLog.eba are in a project together.  I do not have the .inc file in the project.  Should I add it?

If I fully qualify the path it works just fine:


$INCLUDE "d:\animates\client\log\amLog.inc"


Title: Re: Relative Paths for $INCLUDE
Post by: Ionic Wind Support Team on October 24, 2008, 09:40:03 PM
No, don't add the .inc to a project.

Is it possible the .inc file was locked by another process?

Grasping at straws here as I've never had a problem with them.  One of my largest projects uses relative paths extensively as in:


$include "..\GeneralLPPFiles\LPP_typedefs.inc"
$include "..\GeneralLPPFiles\LPP_vardefs.inc"
$include "..\GeneralLPPFiles\LPP_varinit.inc"
$include "..\GeneralLPPFiles\LPP_colors.inc"
$include "..\GeneralLPPFiles\LPP_clearrecords.inc"
.....followed by dozens more.


Paul.

Title: Re: Relative Paths for $INCLUDE
Post by: Hootie on October 24, 2008, 09:50:28 PM
Ok, I messed some more with it.  If I change it to this, it works.



$INCLUDE ".\log\amLog.inc"


It is two dots (..) in C++ but one here.  I'm going to go bang my head on something now.   ???
Title: Re: Relative Paths for $INCLUDE
Post by: Ionic Wind Support Team on October 24, 2008, 10:00:09 PM
Has nothing to do with the languages.  Two dots is interpreted by Windows meaning one directory level up, and one dot means the current directory. 

So either the source file isn't where your you thought it was, or something changed the current directory while the file was compiled.

Paul.
Title: Re: Relative Paths for $INCLUDE
Post by: Hootie on October 24, 2008, 10:21:52 PM
After looking a bit further, the relativeness seems to be related to where the project file is, not the source file.

Directory Structure

\client - contains project .ebp file
    \main - contains amMain.eba
    \log - contains amLog.eba amLog.inc

After compile the parent directory (\client) where the project file is also contains the following intermediate/object files:

$$$lib.link
amLog.a
amLog.o
amMain.a
amMain.o

Also, I have the project set up to put the binary in \bin which is on the same level as \client.  This works fine.