help-octave
[Top][All Lists]
Advanced

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

Re: .oct-file fails to load external shared c++ library (alglib)


From: Jordi Gutiérrez Hermoso
Subject: Re: .oct-file fails to load external shared c++ library (alglib)
Date: Fri, 1 Mar 2013 14:36:41 -0500

On 28 February 2013 17:12, franz2 <address@hidden> wrote:

> This library I compiled from source using:
>
>         gcc -c -O2 -fPIC interpolation.cpp -o interpolation.o
>         gcc -shared -Wl,-soname,libinterpolation.so.1 -o libinterpolation.so.1
> interpolation.o

Why not use the libalglib-dev Debian package instead of mucking around
with ldconfig and compilation?

It's also not clear if you can grab just that one file from the
library without having undefined symbols.


> Now when calling my function from within Octave I get this message:
>         error: ....: /.../bp_yTilt_interpolate.oct: failed to load:
> /usr/lib/alglib/libinterpolation.so.1: undefined symbol:
> _ZN11alglib_impl20matrixmatrixmultiplyEPNS_9ae_matrixEllllbS1_llllbdS1_lllldPNS_9ae_vectorEPNS_8ae_stateE
>
> ... yet when I run 'nm /usr/lib/alglib/libinterpolation.so.1' the
> symbol is found as ...
>
> (...)
>                  U
> _ZN11alglib_impl20matrixmatrixmultiplyEPNS_9ae_matrixEllllbS1_llllbdS1_lllldPNS_9ae_vectorEPNS_8ae_stateE
> (...)
>
> ... indicating it as a global debugging-symbol (upper-case N)

I don't know why you think it's global. After demangling, the symbol
is

    alglib_impl::matrixmatrixmultiply(alglib_impl::ae_matrix*, long,
    long, long, long, bool, alglib_impl::ae_matrix*, long, long, long,
    long, bool, double, alglib_impl::ae_matrix*, long, long, long,
    long, double, alglib_impl::ae_vector*, alglib_impl::ae_state*)

which is certainly not in the global namespace.

At any rate, I can't reproduce this problem. I didn't try with alglib,
but I used mkoctfile with -l to link to an external library without
problems.

Try with the alglib-dev package, and if that fails, post the code
you're using so I can test myself.

- Jordi G. H.


reply via email to

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