Closed Joe23232 closed 3 years ago
Hi @Joe23232 ,
According to https://github.com/odin-lang/Odin/wiki/Binding-to-C it is not made easy to bind with C++ directly.
People usually write a small C wrapper that allow accessing the C++ API with C-like functions.
Does that make sense?
Hi @Joe23232 ,
According to https://github.com/odin-lang/Odin/wiki/Binding-to-C it is not made easy to bind with C++ directly.
People usually write a small C wrapper that allow accessing the C++ API with C-like functions.
Does that make sense?
Hey man,
Yes it does make sense, but is it then somehow possible to write a small C wrapper to access the C++ API and then convert the C wrapper file into Odin, that way Odin would be accessing the C++ API?
I am kinda new to programming so I don't quite know how this kind of stuff works.
To answer simply: yes, it is possible. Once you have your C API (hiding the C++ details) you can either write the Odin binding by hand or use odin-binding-generator to automate this process.
But I am not aware of any tool that can automate the creation of your C API from the C++. As far as I know, it has to be done by hand. Which, depending on the scope of the C++ project, it can be pretty time-consuming.
However:
Hope it helps you. :)
Thanks man it does help :)
Is there a way to convert C++ headerfiles into Odin?