From help-octave-request at bevo dot che dot wisc dot edu Thu Feb 14 07:29:31 2002 Subject: Loading files from within c++ (feval) From: Douglas Eck To: help-octave at bevo dot che dot wisc dot edu Date: Thu, 14 Feb 2002 14:28:04 +0100 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 #include #include #include #include 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 -------------------------------------------------------------