New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking with C possible but blocked by trivial things #218
Comments
yes that is correct dgTypes.h was added to get the export type, by that goes again teh c interface The other c declaration is just one way of making struct declarations, the way we do it is also legal both is c and cpp, I hope this works for you. |
Thanks for looking at this. https://stackoverflow.com/questions/755305/empty-structure-in-c Since that portion is only ever compiled as C, it would be a good idea to just delete the braces. No compiler is going to miss them :) |
oh thsi late, but maybe it si still useful I removed the braces, teh struct are now define liek this
also I start 4.00 |
Newton's API works with C and C-compatible languages, but requires extra header manipulation at the moment.
Newton.h seems to have been prepared with C in mind, but it includes dgTypes.h which is a straight up C++ header. Most of the definitions and includes from that header are not necessary for binding to the plugin's API, we only need the numerical typedefs. The rest should probably live in another header.
Another problem is that the empty structs declared in place of classes are not the standard way to declare an opaque type in C, and many compilers will reject them. The correct way to do that is:
typedef struct NewtonMesh NewtonMesh;
The text was updated successfully, but these errors were encountered: