0 votes
by Philip Butler (150 points)

newbie question, not yet comfortable with vocaularies. on VXF Forth for Win64 on a freshly installed system. Getting libXL (and more generally Externals) to work is important for convincing my boss to use VXF tools.

When including libXL, I get a complaint that "C" is unknown. I then tried to load the file defining the missing word (recursively). It seems that Externals bailed out at line 924, before "C" is defined (line 1849).  What am I missing?

include C:\MPE\VfxForth64\Lib\SharedLibs\libXL\libXL.fth
Including C:\MPE\VfxForth64\Lib\SharedLibs\libXL\libXL.fth
Err# -13 ERR: Undefined word.
 Source: "C:\MPE\VfxForth64\Lib\SharedLibs\libXL\libXL.fth" on line 74
 -> : XLAPIENTRY    "C"  ;
                    ^

include C:\MPE\VfxForth64\VFXBase\Extern.fth
Including C:\MPE\VfxForth64\VFXBase\Extern.fth
TYPES is redefined
EXTERN.VOC is redefined
EXTERNWARNINGS? is redefined
EXTERNREDEFS? is redefined
LIBREDEFS? is redefined
INEXTERNALS? is redefined
INEXTERNALS is redefined
INCURRENT is redefined
CLEAR-LIB is redefined
CLEAR-LIBS is redefined
INIT-LIBS is redefined
FIND-LIBFUNCTION is redefined
.LIBS is redefined
#BADLIBS is redefined
.BADLIBS is redefined
LIBRARY: is redefined
TOPLIB is redefined
FIRSTLIB is redefined
[FIRSTLIB] is redefined
EXTERNLINKED is redefined
INIT-IMPORTS is redefined
Err# -13 ERR: Undefined word.
 Source: "C:\MPE\VfxForth64\VFXBase\Extern.fth" on line 924
 ->   [ also asm-core ] asm-end asm-start [ previous ]  ;    \ flush assembler
                               ^
include C:\MPE\VfxForth64\Kernel\x64Com\sam8687.fth
Including C:\MPE\VfxForth64\Kernel\x64Com\sam8687.fth
Err# -258 ERR: Failed to open requested file.
 -> include C:\MPE\VfxForth64\Kernel\x64Com\sam8687.fth
                                                      ^
include C:\MPE\VfxForth64\Kernel\x64Com\asm8687.fth
Including C:\MPE\VfxForth64\Kernel\x64Com\asm8687.fth
ASM-CORE is redefined
ASM-ACCESS is redefined
Err# -13 ERR: Undefined word.
 Source: "C:\MPE\VfxForth64\Kernel\x64Com\asm8687.fth" on line 581
 -> compiler
           ^

1 Answer

+1 vote
by Stephen Pelc (4.4k points)

There is no need to reload the EXTERN mechanism. It is already part of the VFX Forth base.

LibXL.fth does not include the definitions for Win64. To add these, insert the following code

[defined] Target_x64_Windows [if]
also types definitions
: "C"    fastcall ;
previous definitions
Library: libXL.dll
[then]

After this libXL.fth will compile correctly.

by Philip Butler (150 points)
Brilliant, thanks!

I got it to work with a slight change from what you suggest. I copied  ..\libxl-win-4.4.1\libxl-4.4.1.0\bin64_32\libxl64.dll to C:\Windows\System32 (maybe a bit wild) and used:
Library: libXL64.dll
instead of
Library: libXL.dll
by Stephen Pelc (4.4k points)
As I had downloaded a fresh install, but of the demo version, I assume that this difference is one between the demo and the licensed versions. Good to know that you are up and running.
...