From octave-sources-request at bevo dot che dot wisc dot edu Mon Sep 16 07:17:54 2002 Subject: Re: Calling OCT function inside C++ Code From: Paul Kienzle To: giuseppe-ast dot visalli at st dot com, octave-sources@bevo.che.wisc.edu Date: Mon, 16 Sep 2002 08:17:18 -0400 On Mon, Sep 16, 2002 at 09:51:05AM +0200, giuseppe-ast dot visalli at st dot com wrote: > Hi, > > Trying to develope OCT shared library functions, I need to call a > function available as shared library (OCT) inside my C++ source code. > > Can I declare the function as "extern" ? , If yes How ? > > What Happen If I wish to execute in my C++ code a .m file ? > > What is the syntax ? The function you want is feval: #include octave_value_list retval = feval(fname, args, nargout); fname is a string, args is an octave_value_list and nargout is an integer saying how many return arguments you want. > > I am trying to translate functions mostly compatible with Matlab > Communication ToolBox + New Functions. Assuming it is mex files you are trying to translate, you could try linking against mex.o in octave-forge/extra/mex (http://octave.sf.net). It won't handle the full mex api by any stretch, but it is a start. Paul Kienzle pkienzle at users dot sf dot net