You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I'm almost there, but the header files have some issues when parsed by PHP's FFI. Right now I'm running cpp -P -D "__attribute__(ARGS)=" ~/tmp/Chipmunk2D/include/chipmunk/chipmunk.h -o include/chipmunk.h to get an already pre-processed header file, and I'm removing the #include <stdlib.h>. #include <math.h> lines for now.
My actual problem is a FFI\ParserException: ';' expected, got '{' at line 4 error when trying to load the library.
staticinlinecpFloatcpfmax(cpFloata, cpFloatb)
{ // This is line 4return (a>b) ? a : b;
}
This is my first experience implementing a FFI. There's something I would need to consider? Should I curate my own .h file and write manually there the definitions as I'm needing it?
Maybe could be worth to investigate if a tool like SWIG would help making the library more friendly to make bindings?
The text was updated successfully, but these errors were encountered:
Well, I guess I made some progress manually removing the implementation of those inline functions (for example, turning it like static inline cpFloat cpfmax(cpFloat a, cpFloat b)).
But it seems like those functions are not implemented in the dynamic library, so I can't access to them!
FFI\Exception: Attempt to call undefined C function 'cpv'
Hi! I'm trying to call Chipmunk's FFI from PHP.
I think I'm almost there, but the header files have some issues when parsed by PHP's FFI. Right now I'm running
cpp -P -D "__attribute__(ARGS)=" ~/tmp/Chipmunk2D/include/chipmunk/chipmunk.h -o include/chipmunk.h
to get an already pre-processed header file, and I'm removing the#include <stdlib.h>
.#include <math.h>
lines for now.My actual problem is a
FFI\ParserException: ';' expected, got '{' at line 4
error when trying to load the library.This is my first experience implementing a FFI. There's something I would need to consider? Should I curate my own .h file and write manually there the definitions as I'm needing it?
Maybe could be worth to investigate if a tool like SWIG would help making the library more friendly to make bindings?
The text was updated successfully, but these errors were encountered: