Title: Failed to register external symbol from a DLL
|Product: LispWorks for Windows|
OS: all Windows platforms
|Description: The function needs to be exported from the DLL. This can be done in one of|
1) Use the __declspec(ddlexport) declaration in the C file.
2) Use a /export directive in the link command.
3) Use a .def file.
(For more detail, see under "Export from a DLL" in the VC++ online manuals.)
If you use the first method (#1), you will probably want to make the
functions use the stdcall calling convention since that removes another
level of name mangling.
|See Also: Lisp Support Call #5390|
|Summary:>I created a *very* simple .dll with one file with the following (using VC++ 4.2):|
>int _stdcall fli(void)
>I then compiled the following form
>(fli:define-foreign-function (fli "fli") ()
> :result-type :int
> :calling-convention :stdcall
> :documentation "Just a test to seeif it works"
> :module "d:/users/pedro/c/fli/release/fli.dll")
>I then called it as such: (fli) and I got the following error:
>Condition: Failed to register external symbol #<FLI::EXTERNAL-SYMBOL "fli" :
>addr = #x00000000>.