Stop using stdcall in your typedef. The lite-c compiler may not know any other callingconventions then cdecl so stack is cleaned up 2 times (by caller and callee) and will crash you. Try cdecl. EDIT: Im also not sure if lite-c can handle double o.o Try float sicne double is 8byte