title: LuaJIT FFI load dll error
body: <p>I want to code some functions in C to use in Lua and the easiest way to do this I think I can find is using LuaJIT's FFI.</p>
  
  <p>I have a C file "add.c":</p>
  
  <pre><code>int add(int a, int b){
  return a+b;
  }
  </code></pre>
  
  <p>I assemble it into "add.o" with:</p>
  
  <pre><code>gcc -c add.c
  </code></pre>
  
  <p>I make "add.dll":</p>
  
  <pre><code>gcc - shared -o add.dll add.o
  </code></pre>
  
  <p>Finally, I try to run the following Lua code in LuaJIT:</p>
  
  <pre><code>local ffi =require("ffi")
  
  local test=ffi.load("C:\\users\\quebe\\Desktop\\add")
  
  ffi.cdef[[
  int add(int a,int b);
  ]]
  
  print(test.add(1,2))
  </code></pre>
  
  <p>and get:</p>
  
  <pre><code>luajit: test.lua:3: cannot load module 'C:\users\quebe\Desktop\add': %1 is 
  not a valid Win32 application.
  
  stack traceback:
      [C]: in function 'load'
      test.lua:3: in main chunk
      [C]: at 0x7ff72be120c0
  </code></pre>
  
  <p>but I have no idea how to interpret this to debug.</p>