1. c++ cod
- Posted by luk321 Jan 17, 2011
- 1339 views
Can any one tell me a good way to call routines and code I write in CPlusPlus files from euphoria scripts?
In the cxx file, my functions wouldnt export until I put the functions in an extern "C" {...} block and then that seemed to work with gcc in debian.
Does this work in general, or is there a better way?
2. Re: c++ cod
- Posted by mattlewis (admin) Jan 17, 2011
- 1291 views
Can any one tell me a good way to call routines and code I write in CPlusPlus files from euphoria scripts?
In the cxx file, my functions wouldnt export until I put the functions in an extern "C" {...} block and then that seemed to work with gcc in debian.
Does this work in general, or is there a better way?
In general, yes. Each C++ compiler uses its own name mangling scheme. For wxEuphoria, I used to track the mangling for the compilers on different platforms. Now, I wrap the wxWidgets C++ calls with my own library and export the functions as extern "C", and it's much easier (except that I have to distribute my own library to wrap wxWidgets).
Matt