octave-maintainers
[Top][All Lists]
Advanced

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

embedded octave: how to define new functions?


From: John W. Eaton
Subject: embedded octave: how to define new functions?
Date: Tue, 5 Sep 2006 16:15:36 -0400

On  3-Sep-2006, Andrea Latina wrote:

| Hi all,
| 
| I would like to embed octave into my code. I've used the canonical
| octave_embed.tgz example as a starting point. It compiles and works
| fine, but I've encountered a problem as soon as I've tried to define,
| with DEFUN(), my first new function.
| 
| To begin, I've copied the classic oregonator example into my code and
| changed DEFUN_DLD for DEFUN (because my function should be considered
| "built in", not loadable) but the programs doesn't see it, and just
| tells me:
| 
| error: 'oregonator' undefined bla bla bla
| 
| Where am I wrong? What should I do ta make my new functions visible to octave?

You have to register them with the interpreter.  When Octave is built,
there is a script that scans the sources for DEFUN macros and builds
the file builtins.cc.  Look at that script and the generated file to
see what it is doing, and do that.

jwe


reply via email to

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