Re: c_func in Eu 4.1 Beta (Windows)
- Posted by mattlewis (admin) Mar 18, 2014
- 1536 views
Jerome said...
Well, I could be doing something silly here but I can't get c_func to work on 32-bit Windows for the latest Eu (the beta release and the latest tip do not work for me).
Ah...this is a calling convention problem. The dll is expecting cdecl (the default when you write C code), but the way it's imported in the code, you end up calling with stdcall (a win32 aberration). Try changing to "+sum" in the define_c_func call and it should work. You probably have the same problem in your other code.
I believe that Watcom added its own cleanup code no matter the calling convention, so it could hide this problem, but we're not building with Watcom any more.
Matt