help-octave
[Top][All Lists]
Advanced

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

Re: Shared Libraries and Coda


From: michaeld . jones
Subject: Re: Shared Libraries and Coda
Date: Tue, 20 Jul 2004 17:34:06 -0400


So I don't necessarily need to link dynamically but it ends up that your example prompted me to use g++ instead of gcc and everything is fine now. Do you have any opinion on when to use dynamically linked versus statically linked libraries?



Geraint Paul Bevan <address@hidden>

07/20/2004 05:01 PM

       
        To:        MichaelD Jones/PH/address@hidden
        cc:        address@hidden
        Subject:        Re: Shared Libraries and Coda



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

address@hidden wrote:
| I have a simple test case I am using to see how I can get custom shared
| libraries called from a user oct-file. I have GNU Octave, version 2.1.57
| (i686-pc-linux-gnu). I used  configure --enable-shared before I
installed.
| I also have successfully installed octave-forge
octave-forge-2004.07.07. I
| am using RedHat Linux 9. After compiling I installed  libshare.so.1.0.1
| and made appropriate links in /usr/local/lib.
|
| I tested the libshare.so library with a stand-alone app and it worked
| fine. When I run the octshare command in the directory containing the
| octshare.oct file in octave I get the following output.
|
| octave:1> octshare
| Test: Called internal method OK!
| octave: relocation error: /home/jonesmic/swack/test/coda2/octshare.oct:
| undefined symbol: _Z13getSomeNumberv
|
| Any body know what I might be missing?
|


I suppose the first question is, do you actually need to link against
the library at run time or would a static link suffice? If you only need
static linking, you can include share.o (or libshare.so) on the command
line when you use mkoctfile:

$ g++ -c share.c
$ ls
octshare.cc  share.c  share.h  share.o
$ mkoctfile octshare.cc share.o
$ octave -q
octave:1> octshare
Test: Called internal method OK!
Test: Called libshare method OK!
ans =
(
~  [1] = 1000
~  [2] = 199.99
)


- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iEYEARECAAYFAkD9iBIACgkQcXV3N50QmNNgoACfcsDaP5G+6bsqU92Dqd+elG+b
LzQAoIz2aRNjg5JYspudnjMPX7Ho6tJv
=534i
-----END PGP SIGNATURE-----



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

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




reply via email to

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