#Cpp Lib

10 messages · Page 1 of 1 (latest)

stiff lintel
#

Greetings once again odin-folk,
I have a question i seek answers to.
I have this cpp library that I would like to consume with Odin. How would I go about doing this?

  • Should I rewrite the parts of the code that I need in Odin?
  • Should I compile a .lib from the cpp project and write and consume it that way? If so then how? How would classes be consumed?
  • Seek or create a C wrapper for the cpp project?
scenic ravine
#

It depends, if it's a small library rewriting it might not be a bad idea. otherwise, if it doesn't extern "C" the things you need, then yeah you'll need to make a C wrapper. If it's COM, odin has some facilities to bind to those as well, and making bindings to class vtables isn't too bad. what library are you trying to bind to?

nocturne delta
#

Indeed. Option 3. Write C wrappers for what you call.

stiff lintel
stiff lintel
stiff lintel
#

Would something like this:

#

Be sufficient for Odin to consume?

#

granted that I also add foreign lib {} block in a Odin file?

zenith herald
storm basin