jmckaskill / luaffi

Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.
469 stars 84 forks source link

Build on mingw on Windows #62

Open moteus opened 10 years ago

moteus commented 10 years ago

this is my simple bat file

G:\lua\5.1\lua.exe dynasm\dynasm.lua -LNE -D X64 -D X64WIN -o call_x64win.h call_x86.dasc
G:\lua\5.1\lua.exe dynasm\dynasm.lua -LNE -D X32WIN -o call_x86.h call_x86.dasc
G:\lua\5.1\lua.exe dynasm\dynasm.lua -LNE -D X64 -o call_x64.h call_x86.dasc
G:\lua\5.1\lua.exe dynasm\dynasm.lua -LNE -o call_arm.h call_arm.dasc
gcc -O2 -g0 -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -o test.o -c test.c
gcc -shared -fPIC test.o -o test_cdecl.dll
gcc -O2 -g0 -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -D_WIN32_WINNT=0x0501 -IG:\lua\5.1\include -o ffi.o -c ffi.c
gcc -O2 -g0 -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -D_WIN32_WINNT=0x0501 -IG:\lua\5.1\include -o ctype.o -c ctype.c
gcc -O2 -g0 -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -D_WIN32_WINNT=0x0501 -IG:\lua\5.1\include -o parser.o -c parser.c
gcc -O2 -g0 -Wall -Werror -fvisibility=hidden -Wno-unused-function --std=gnu99 -D_WIN32_WINNT=0x0501 -IG:\lua\5.1\include -o call.o -c call.c
gcc -shared ffi.o ctype.o parser.o call.o G:\lua\5.1\lua5.1.dll -o ffi.dll

.\test.lua

This is output for test (i load only test_cdecl.dll)

Running test
check   1       2
test.lua:27: assertion failed!
stack traceback:
        [C]: in function 'assert'
        F:\E\Projects\lua-ffi\test.lua:27: in function 'check'
        F:\E\Projects\lua-ffi\test.lua:485: in function 'check_align'
        F:\E\Projects\lua-ffi\test.lua:507: in main chunk
        [C]: ?
jhernancanom commented 8 years ago

Hi, moteus. How do you complete your proofs for building/compiling this fork on Windows? My interests: Win32, Lua5.3 .

Thanks.