help-octave
[Top][All Lists]
Advanced

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

Loading files from within c++ (feval)


From: Douglas Eck
Subject: Loading files from within c++ (feval)
Date: Thu, 14 Feb 2002 14:28:04 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011221

I'm reluctant to file a bug report but I can't get feval to
work in 2.1.35 in a stand-alone C++ application. What I want
to do is load a .mat file. That .mat file contains
matrices and structs.  Is this even possible?
I've tried many permutaitons of this feval call
using the mailing list archives as a guide. None seem
to work. Here's one failed attempt. :

#include <octave/oct.h>
#include <octave/ov-struct.h>
#include <octave/parse.h>
#include <octave/oct-map.h>
#include <math.h>
int main(int argc, char * argv[]) {
  octave_value_list args;
  args(0) = "tst.mat";
  args(1) = "a";
  feval("load", args, 0); // no arguments returned
  cout << "done" << endl;

I took that from Paul K's posting of a while back. I compiled it using;

g++ -pg -g tstFile.o  -o tstFile -L/usr/lib/octave-2.1.35 
-L/usr/src/octave-2.1.35/kpathsea \
   -lblas -loctave -loctinterp -ldl  -lcruft  -lg2c -ltermcap -lhdf5 -lreadline 
-lkpathsea -lfftw

And I get a segfault. This happens when I run on our alpha or on my pentium box.
Both run Dirk's debian packages.

Here's the segfault message from GNU gdb 5.1
(gdb) run
Starting program: /home/doug/src/tstFile/tstFile

Program received signal SIGSEGV, Segmentation fault.
0x200009aee38 in symbol_table::hash () from 
/usr/lib/octave-2.1.35/liboctinterp.so.2.1.35

Cheers,
Doug



-------------------------------------------------------------
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]