I'm trying to learn a bit of C so I can use FFI, but I'm having a bit of trouble with some things, and I was hoping somebody with more experience/technical know-how could help me out here.
I'm following this tutorial. So I started by installing gcc with Cygwin.
Everything compiles correctly with the file to the shared object. When I try to load it from the LuaJIT command line, however, it fails at this point:
Code: Select all
> ffi = require 'ffi'
> start = ffi.load( 'libfirst.so' )
stdin:1: cannot load module 'libfirst.so': %1 is not a valid Win32 application.
So then, just for kicks, I tried compiling it and running it from the Cygwin command line. With the -m32 flag, it fails with a ton of errors. Without -m32, it compiles without issue. Then, when I run LuaJIT from the command line, it works!
With LOVE, it's the same story, with even more of a twist: When I run LOVE from the command line (all compiled from the Windows command line), the file can't be found. When I run LOVE from Cygwin (all compiles from Cygwin) it works.
Anyway, it's all really bizarre, but I was hoping somebody had some insights into this problem.
Thanks