Calling C++ / external stuff via MAX

BlitzMax Forums/BlitzMax Programming/Calling C++ / external stuff via MAX

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

guess I am screwed then

That's a bit defeatist, don't ya think?

I had thought wrapping a C++ library (with no C++ experience) was going to be a show-stopper for me too... but after hacking a couple of C libraries (which don't require much glue), it turned out that it wasn't so hard after all.

I ended up using both the tiny documented example in the Blitz help, and browsing through Skid's FLTK glue to give me a guide as to what I could do. (Thanks Skid! :-)

Essentially, I end up with a .cpp file of my own which I use Extern "C" to expose some of my own functions which can call into C++ objects etc.
Of course, you need to know a bit of C/C++, but if you intend wrapping an external library, it's to be expected (I usually learn what I need to know as I go :-p )

I would suggest taking a look at some of the already-wrapped libraries that people have done to point you in the right direction.