red icon indicating copy to clipboard operation
red copied to clipboard

Compiler: `#include file` with absolute path of file including other files, wont find included files

Open x8x opened this issue 8 years ago • 3 comments

Let's work in path /dev/. Let's have file %test.red with content:

Red []

#include %/git/red/red/environment/console/console.red

now try to compile it:

  % red -r -c test.red

-=== Red Compiler 0.6.1 ===- 

Compiling /dev/test.red ...
*** Compilation Error: include file not found: input.red 
*** in file: /dev/test.red
*** near: [
    #include %input.red 
    #include %help.red 
    #include %engine.red 
    system/console/launch #pop-path
]

Now the same with a relative path:

Red []

#include %../git/red/red/environment/console/console.red

compile:

  % red -r -c test.red

-=== Red Compiler 0.6.1 ===- 

Compiling /dev/test.red ...
...compilation time : 226 ms

Target: Darwin 

Compiling to native code...
...compilation time : 2480 ms
...linking time     : 98 ms
...output file size : 163840 bytes
...output file      : /dev/test 

No problem :-) (tested on macOS and Linux)

x8x avatar Mar 18 '17 05:03 x8x

Does it work if you compile with -r instead of -c? Current console code contains a lot of R/S code, so it can't be properly compiled with just -c.

dockimbel avatar Mar 18 '17 05:03 dockimbel

It doesn't. BTW I did a red -u .. before and LibRT really makes debugging faster! Kudos! 👍

x8x avatar Mar 18 '17 06:03 x8x

Same issue on Linux

x8x avatar Mar 18 '17 06:03 x8x