help-octave
[Top][All Lists]
Advanced

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

Using Octave from C++


From: John W. Eaton
Subject: Using Octave from C++
Date: Tue, 22 Feb 2000 15:12:12 -0600 (CST)

On 22-Feb-2000, Dejan Beznec <address@hidden> wrote:

| Hello!
| I have browsed all the documentation includede in the source
| distribution of Octave 2.0.16 and I couldn't find satisfactory answer.
| 
| Is it possible to use Octave functions and data types from a standalone
| C++ program (not vice versa)?
| For example:
| ----- test1.cc ------
| #include <octave/oct.h>
| 
| main(){
|  Matrix A;
| }
| ---------------------
| I tried to compile it with:
| g++ -o test1 test1.cc -loctave -lcruft -loctinterp
| 
| and it yielded the following error:
| /usr/local/lib/octave/liboctave.so: undefined reference to
| `append_history'
| /usr/local/lib/octave/liboctinterp.so: undefined reference to `dlerror'
| /usr/local/lib/octave/liboctinterp.so: undefined reference to
| `rl_instream'
| /usr/local/lib/octave/liboctinterp.so: undefined reference to
| `rl_read_init_file'
| /usr/local/lib/octave/libcruft.so: undefined reference to `do_lio'
| /usr/local/lib/octave/libcruft.so: undefined reference to `e_wsle'
| /usr/local/lib/octave/liboctinterp.so: undefined reference to
| `history_set_pos'
| /usr/local/lib/octave/liboctave.so: undefined reference to
| `write_history'
| 
| [Snip]
| 
| Is there some library I forgot to include, or I have misunderstood some
| major concept?

Unless you are using features of the interpreter, you don't need
liboctinterp.  But you may need other things that are referenced by
liboctave and libcruft, such as the Fortran libraries (system
dependent, but the list appears in the generated mkoctfile script)
readline, kpathsearch, and the dynamic linking library.

Eventually, I'd like to eliminate most of these dependencies so that,
for example, you don't have to link to readline unless you really need
it.

jwe



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

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