http://www.freelists.org/post/luajit/lua-ffi-access-to-alien-static-or-global-variables,5
The symbols must be extern and not static. On Windows, the symbols on the C side must be declared as __declspec(dllexport) (or the corresponding linker options). On the Lua side: local ffi = require("ffi") ffi.cdef[[ int my_global; ]] local mylib = ffi.load("mylib") print(mylib.my_global) Works the same with pointers, structs, etc. If you don't want to fill the namespace with lots of symbol names, consider using a single exported struct that holds all variables (or pointers to them).