help-octave
[Top][All Lists]
Advanced

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

Re: How to link two oct files


From: Olaf Till
Subject: Re: How to link two oct files
Date: Mon, 30 Jun 2014 17:06:02 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jun 30, 2014 at 07:15:25AM -0700, gumlym wrote:
> Hello
> 
> I have two oct files, in which I have two functions, defined by DEFUN_DLD. I
> also have a static variable defined in one of the .cc files. The thing is
> that in the c specification it says that :
> 
> static int shared = 3;     /* This is the file-scope variable (with internal
> linkage),
>                             * visible only in this compilation unit. 
>                             */
> 
> Which, given that each oct file is compiled individually, means that the
> variable is only visible in the oct file in which it was declared. How can I
> compile (or link) two oct files together so that I can use that static
> variable in both of them?

You can define both functions within one file and call Octaves
autoload() function (see `help autoload') to access them.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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