help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

calling feval from standalone c++ code


From: adler
Subject: calling feval from standalone c++ code
Date: Tue, 2 Oct 2001 19:32:44 -0400 (EDT)

I'm trying to call feval from a standalone
c++ code linked to the octave libraries.

The code given here will compile but segfaults
on execution. (I've tried all sorts of LD_LIBRARY_PATHs)

Could someone tell me if calling
feval this way makes any sense at all?

If anyone wonders why I'm doing this:
I'm trying to write an Inline::Octave perl
module.  Right now I can access all of
liboctave from Inline::CPP with the right
compile options. If there were a way
to access compiled octave functions and
*.m files, this would be really powerful.


here is the code

----------stand.cc   ------------
#include <octave/oct.h>
#include <octave/parse.h>
int
main(){
  octave_value_list i;
  i(0)= 1.0;
  i(1)= 1.0;
  octave_value_list o= feval("rand",i,1);
  return (int) ( o(0).double_value() );
}
----------compile with -------------

cc stand.cc -I/usr/local/include/octave \
   -L/usr/local/lib/octave -loctave -loctinterp -lcruft \
   -ldl -lstdc++ -lg2c -lncurses \
   -L/usr/src/octave-2.1.34/kpathsea  -lkpathsea \
   -L/usr/src/octave-2.1.34/readline  -lreadline

_______________________________________
Andy Adler,                address@hidden




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]