From octave-maintainers-request at bevo dot che dot wisc dot edu Fri Dec 13 15:18:58 2002 Subject: Creating a standalone executable From: JD Cole To: octave-maintainers at bevo dot che dot wisc dot edu CC: Paul Kienzle Date: Fri, 13 Dec 2002 12:37:46 -0800 I am trying to write a standalone application using the Octave API and am running into some trouble when I actually run the application. Here's what I did: source code (a.cc) ========= #include #include using namespace std; int main(int argc, char *argv[]) { octave_value a(10.0),b(20.0),c; c = a + b; c.print(cout); return (0); } how I compiled it ============= Initially I tried using the "--link-stand-alone" argument to mkoctfile, but it seemed to be missing the library arguments "-lkpathsea -loctinterp" or else I get missing symbols related to these two libraries. So I used "mkoctfile -c a.cc -o a.o" to copile the object file and then added the above libraries to the output of "mkoctfile --verbose -o a a.o". Which seems to compile just fine. when I ran it ========= Running "./a" yields the following output: fatal: range error in Array3 This error comes from "checkelem" in Arrray3.h. Of course, to my knowledge, I'm only using scalars. I tried changing my source to just "c = a" rather than "c = a +b" and it performed as expected. I investigated the operator instantiations of "+" in ov.h and was a bit confused. Another note: I did try putting the above code into a DLD_FUNTION and it performed as expected. I guess my question here is, "Has anyone done this before?" Best, JD