help-octave
[Top][All Lists]
Advanced

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

Re: liboctave library in stand-alone C++ program


From: Joao Cardoso
Subject: Re: liboctave library in stand-alone C++ program
Date: Fri, 18 Jun 1999 20:36:49 +0100

Suttipan Limanond wrote:
> 
> Hi:
> 
> I apologize for asking a bit off-topic subject.
> 
> Has anyone link liboctave to standalone C++ program?
> What other libraries beside liboctave need to be linked in to make
> it work? I linked liboctave, libcruft, and libatlas (tuned BLAS)
> in but the `ld' linker still complains about a lot about `undefined
> symbols'. When I use `mkoctfile' to compile (with `main(){' replaced by
> `DEFUN_DLD(.....)'), however, everything is fine.
> 
> Thank you very much,
> 
> Suttipan Limanond.
> 
> PS: This is the exact command and
> some of the undefined symbols:
> 
> command:
> g++ -g -Wall -o cartpole -I/usr/local/include
>   -L/usr/local/lib/octave-2.0.13 NeuralNetwork.cc backprop.o plant.o
>   -loctave -lcruft -latlas
> 

I guess that you need to link against libstdc++ and other system
libraries like -lm. When you use `mkoctfile' you will use the compiled
function from within Octave, that is already linked with those
libraries. For a standalone program, however, you need to specify them
at link time. One way to know what they are is looking in the Makefile
of the Octave distribution, sibdirectory src, target octave. Other way,
if your Octave has been dinamically linked, is to use the `ldd' command
on the Octave binary to find out what the libraries are. On my system,

[merlin 283] ldd /usr/local/bin/octave
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/local/lib/octave-2.1.13/liboctinterp.so
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/local/lib/octave-2.1.13/liboctave.so
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/local/lib/octave-2.1.13/libcruft.so
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/lib/libsocket.so.1
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/local/lib/libgmalloc.so
dynamic linker: /usr/local/bin/octave: file loaded:
/usr/local/lib/libstdc++.so
dynamic linker: /usr/local/bin/octave: file loaded: /usr/lib/libc.so.1

on your system you might have also ...libm.so.

Luck
Joao

> Some of the undefined symbols:
> xerbla.o: Undefined symbol `_s_wsfe' referenced from text segment
> xerbla.o: Undefined symbol `_do_fio' referenced from text segment
> xerbla.o: Undefined symbol `_do_fio' referenced from text segment
> xerbla.o: Undefined symbol `_e_wsfe' referenced from text segment
> zgemv.o: Undefined symbol `_d_cnjg' referenced from text segment
> zgemv.o: Undefined symbol `_d_cnjg' referenced from text segment
> qzhes.o: Undefined symbol `_d_sign' referenced from text segment
> qzhes.o: Undefined symbol `_d_sign' referenced from text segment
> qzhes.o: Undefined symbol `_d_sign' referenced from text segment
> qzit.o: Undefined symbol `_d_sign' referenced from text segment
> qzit.o: Undefined symbol `_d_sign' referenced from text segment
> qzit.o: Undefined symbol `_d_sign' referenced from text segment
> qzit.o: Undefined symbol `_d_sign' referenced from text segment
> qzit.o: Undefined symbol `_d_sign' referenced from text segment
> qzval.o: Undefined symbol `_d_sign' referenced from text segment
> qzval.o: More undefined symbol _d_sign refs follow
> dgesvd.o: Undefined symbol `_s_cat' referenced from text segment
> dhseqr.o: Undefined symbol `_s_cat' referenced from text segment
> dhseqr.o: Undefined symbol `_s_cat' referenced from text segment
> dlabad.o: Undefined symbol `_d_lg10' referenced from text segment
> dlamch.o: Undefined symbol `_pow_di' referenced from text segment
> dlamch.o: Undefined symbol `_pow_di' referenced from text segment
> dlartg.o: Undefined symbol `_pow_di' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: Undefined symbol `_s_cmp' referenced from text segment
> ilaenv.o: More undefined symbol _s_cmp refs follow
> zgebal.o: Undefined symbol `_d_imag' referenced from text segment
> zgebal.o: Undefined symbol `_d_imag' referenced from text segment
> 
> ---------------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.  To ensure
> that development continues, see www.che.wisc.edu/octave/giftform.html
> Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
> ---------------------------------------------------------------------

-- 
Joao Cardoso                |   e-mail: address@hidden
INESC, R. Jose Falcao 110   |   tel:    + 351 2 2094322
4050 Porto, Portugal        |   fax:    + 351 2 2008487



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

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