help-octave
[Top][All Lists]
Advanced

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

Re: Shared Libraries and Coda


From: Geraint Paul Bevan
Subject: Re: Shared Libraries and Coda
Date: Tue, 20 Jul 2004 23:04:17 +0100
User-agent: Mozilla Thunderbird 0.5 (X11/20040306)

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

address@hidden wrote:
| 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?
|


Ah, I hadn't noticed that you had used gcc instead of g++. If for any
reason you did want to use gcc, you would have to use 'extern "C" {...}'
to declare the C function,

share.h:

#ifndef _SHARE_H
#define _SHARE_H

#include <stdio.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

float getSomeNumber();

#ifdef __cplusplus
}
#endif

#endif



I don't have any great insight regarding dynamic versus static linking.
I would tend to link dynamically if distributing a binary which links
against a large library that I would expect users to already have
installed on their machine, or a library which would be needed by many
other applications.

Alternatively, if you are going to have to distribute the library with
the .oct file anyway, you may as well link it statically.

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

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

iEYEARECAAYFAkD9luEACgkQcXV3N50QmNOHMwCdFAv2Pkmme6IjcPKljTsHyVL9
hE8AnRoqbTokGdI+fXLSNRGa4/vijS5c
=NP7x
-----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]