Page 1 of 1

How to call C++ functions from XC?

Posted: Fri Jun 19, 2015 12:48 pm
by Guest

Answer 3432

Posted: Fri Jun 19, 2015 12:49 pm
by Guest
Calling C++ from xC is much the same as calling C++ from C. You'll need to write wrapper functions that are implemented in C++ that have C linkage (i.e. are tagged with extern "C"). For more details see:

https://isocpp.org/wiki/faq/mixing-c-and-cpp

There's an simple example which calls between C++ and xC on github.

https://github.com/rlsosborne/app_calling_cxx_from_xc

You might also want to take a look at the following post:

https://www.xcore.com/forum/viewtopic.php?f=26&t=3017
 
Added for the benifit of other users (Original Forum Topic : http://www.xcore.com/forum/viewtopic.php?f=26&t=3337)