octave-maintainers
[Top][All Lists]
Advanced

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

Re: "oct files" within the embedder


From: John W. Eaton
Subject: Re: "oct files" within the embedder
Date: Mon, 20 Feb 2006 15:35:07 -0500

On 17-Feb-2006, David Bateman wrote:

| Sebastien Loisel wrote:
| 
| > David,
| >
| > If I mkoctfile foo.cpp -o foo.oct then I get a function in octave, 
| > called foo, that I can call. However, if instead I g++ foo.cpp -o 
| > foo.o and then statically link foo.o into my embedder, the function 
| > isn't visible in octave. Is there a way for my embedder to add it to 
| > the namespace, or am I better off just making oct files?
| >
| > Cheers,
| >
| > Sébastien Loisel
| 
| It should be available as a function called Ffoo.

That would be the name of the function in C++.

If you want to call it from the scripting language, then you need to
do something extra to install the function in Octave's symbol table.
For .oct files, this is handled automatically when the .oct file is
loaded.  For built-in functions, this is handled by builtins.cc.  The
code for that file is generated automatically at build time, and the
install_builtin function (defined at the bottom of builtins.cc) is
called from octave_main (defined in src/octave.cc).

jwe



reply via email to

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