Recent

Author Topic: Project options: include path seems to be ignored  (Read 8985 times)

mgerwinski

  • Newbie
  • Posts: 6
Project options: include path seems to be ignored
« on: April 11, 2011, 03:03:06 pm »
Hello,

when trying to compile the "dynamic_ambient occlusion" example program from the Kambi VRML Game Engine project in my IDE (Lazarus 0.9.30 on a Windows XP system), I always get a "Can't open include file" error.

Fair enough, but the error doesn't go away when I add the include file's path to the "Project options: include files" path and also the "units" path. I tried relative path and absolute path, to no avail.

Am I missing something here?

Thanks in Advance,

  Markus

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Project options: include path seems to be ignored
« Reply #1 on: April 11, 2011, 03:28:16 pm »
Example:
Code: [Select]
{$INCLUDE include/draw.inc} will look to subdirectory include for a file draw.inc

In this case, I have in Project Options-> Include files this:
Code: [Select]
$(LazarusDir)/lcl/include;include
See also: http://www.freepascal.org/docs-html/prog/progsu37.html

Note: Linux is case-sensitive and path is without quotes.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

mgerwinski

  • Newbie
  • Posts: 6
Re: Project options: include path seems to be ignored
« Reply #2 on: April 11, 2011, 03:42:36 pm »
Example:
Code: [Select]
{$INCLUDE include/draw.inc} will look to subdirectory include for a file draw.inc
... relatively to the project options "include files" path, right?

The code line in the example project I'm trying to compile simply reads:
Code: [Select]
{$I kambiconf.inc}
On my machine, the file kambiconf.inc is located at C:\Tools\kambi_vrml_game_engine\src\base, so this is the path I inserted into the project options (no quotes or similar added).

Note: Linux is case-sensitive and path is without quotes.
I know, but as already mentioned: I'm working on Windows.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Project options: include path seems to be ignored
« Reply #3 on: April 11, 2011, 03:47:02 pm »
Includes in source are always relative to the working dir of the compiler.

mgerwinski

  • Newbie
  • Posts: 6
Re: Project options: include path seems to be ignored
« Reply #4 on: April 12, 2011, 11:27:04 am »
Includes in source are always relative to the working dir of the compiler.
OK, but what is the "include files" path option for, then, if it doesn't change this at all?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Project options: include path seems to be ignored
« Reply #5 on: April 12, 2011, 11:37:52 am »
Includes in source are always relative to the working dir of the compiler.
OK, but what is the "include files" path option for, then, if it doesn't change this at all?

It is to supply includefile directories on the commandline. Not for partial path completion.

In general IMHO it is a good habit to never store paths in sources.

mgerwinski

  • Newbie
  • Posts: 6
Re: Project options: include path seems to be ignored
« Reply #6 on: April 12, 2011, 11:43:12 am »
It is to supply includefile directories on the commandline. Not for partial path completion.

In general IMHO it is a good habit to never store paths in sources.

Uh... sorry, but I'm not sure if you are understanding what I'm trying to do.

First: as I said, the source code in question isn't by me. It is an example code to a library I'm trying to work with.

Second: there is no path in the source. See my code snippet above. There is only the file name, without path.

Third: what, please, is an includefile directory if not a directory where to find include files??

 

TinyPortal © 2005-2018