Re: FFI symbol resolution problems on Windows

  • From: Mike Pall <mike-1412@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 16 Dec 2014 21:35:30 +0100

Konstantin Olkhovskiy wrote:
> [1510](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x000154d0 _apr_env_get@12
> 
> So the symbol is decorated with an underscore and that 'at' number.

That number gives the number of stack slots used by arguments.
Which implies, it can only be found if the declaration is correct.

A correct declaration would be:

ffi.cdef[[
// <-- Add definitions for apr_* types here.
apr_status_t __stdcall apr_env_get(char **value, const char *envvar, apr_pool_t 
*pool);
]]

local apr = ffi.load("...") -- <-- Use the DLL name here
print(apr.apr_env_get) -- Ought to print cdata<...>

--Mike

Other related posts: