octave-maintainers
[Top][All Lists]
Advanced

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

Creating a standalone executable


From: JD Cole
Subject: Creating a standalone executable
Date: Fri, 13 Dec 2002 12:37:46 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

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 <octave/oct.h>

#include <iostream>

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




reply via email to

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