[scilab-Users] scilab and C++

bernard.hugueney at scilab.org bernard.hugueney at scilab.org
Fri Oct 8 09:12:39 CEST 2010


On Fri, 8 Oct 2010 08:58:19 +0200, "Collewet Guylaine"
<guylaine.collewet at cemagref.fr> wrote:
> Hello,
> 
> I'd like to interface scilab with C++ functions
> 
> Is it necessary to write a C function to make the "bridge" between
scilab
> and C++ ? Or are there other ways to do it ?
> 
> thanks
> 
> Guylaine

Hello,

As a rule, you can provide a C ABI (aplication binary interface) to any
C++
function (provided de agrs & returned types are meaningful in C, of
course)
by declaring the prototype «extern "C"». If possible, I would suggest to
only
declare your functions extern "C", otherwise, to write a small (one liner
?)
wrapper «extern  "C"» making the bridge.

Hope this helps.

Best regards,

Bernard Hugueney

[0]
http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code



More information about the users mailing list