The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Strategy for interfacing c-mex s-function with external model
Replies: 5   Last Post: Jan 9, 2012 6:11 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rune Allnor

Posts: 4,455
Registered: 12/7/04
Re: Strategy for interfacing c-mex s-function with external model
Posted: Jan 9, 2012 4:52 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 9 Jan, 21:34, "Kate J." <> wrote:

>           ~ One additional consideration: the .dll that contains the biomechanical model function I?d like to use is written in C++, whereas my c-mex s-function is, of course, in C. However, it doesn?t appear that there are many real syntax differences, apart from minor issues such as comment indicators, etc. In another part of my system, the ?extern C? keyword is used to make C++ code compatible with my C code, so I?m thinking that this *may* be an option here, as well.

You should think very carefully through how you
will publish the C++ interface. Yes you are right
in that the 'extern C' keyword transforms the C++
code to be callable from C, but that only works
for free functions, not objects.

Depending on how far you will distribute your code,
there is an option to write you C and C++ code
independently, and compile it as C++ MEX. This
option might save you a lot of grief.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.