cannot resolve symbol 'printf' with ffi (msvc 14.0)

  • From: Thomas Jammet <jammetthomas@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 15 Apr 2017 18:37:18 +0200

I am trying to run the basic example from FFI :





*local ffi = require("ffi")ffi.cdef[[int printf(const char *fmt,
...);]]ffi.C.printf("Hello %s!", "world")*

And here is the result :






*cannot resolve symbol 'printf': The specified procedure could not be
found.stack traceback:        [C]: in function '__index'
...rkspace\MonaServer\MonaServer\Debug\www\testffi\main.lua:5: in main
chunk        [C]: at 0x00281dc0*

I don't know what I am missing but functions from stdio seems not
available.
I have compiled luajit with Visual Studio Express 2015 (v. 14.0.25420.01
Update 3). I have tried with last commit
(247b3624ffa7f01ee39fb62d4c1b0d1de0f5ef9b)
and with releases 2.0.4, 2.0.1, 2.0.0 but it is always giving the same
result. Any idea?

In addition I haven't built luajit with any parameters, just
"msvcbuild.bat" from VS2015 command prompt.

Thank you

Other related posts: