help-octave
[Top][All Lists]
Advanced

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

Re: Rebuild Oct file does not change the executable


From: siko1056
Subject: Re: Rebuild Oct file does not change the executable
Date: Fri, 28 Apr 2017 00:22:28 -0700 (PDT)


Thomas D. Dean-2 wrote
> I rebuild an .oct file but, execution does not change the results.
> 
> #include <octave/oct.h>
> #include <octave/oct-map.h>
> 
> DEFUN_DLD (create_struct_array, , ,
>                  "example of struct array")
> {
>    octave_idx_type n = 3;
> 
>    Cell avals (n, 1);
>    Cell bvals (n, 1);
> 
>    for (octave_idx_type i = 0; i < n; i++)
>       {
>         avals(i) = i*7;
>         bvals(i) = i+1;
>       }
> 
>    octave_map m;
> 
>    m.assign ("a", avals);
>    m.assign ("b", bvals);
> 
>    return octave_value (m);
> }
> 
> The above courtsey of jwe
> 
> mkoctfile create_struct_array.cpp
> 
> creates create_struct_array.oct
> 
> octave:124> m=create_struct_array()
> m =
> 
>    3x1 struct array containing the fields:
> 
>      a
>      b
> 
> Changing the value of n to n = 8 and saving the file,
> 
> mkoctfile create_struct_array.cpp
> 
> creates create_struct_array.oct with a new timestamp
> 
> octave:125> m=create_struct_array()
> warning: library /home/tomdean/Math/Octave/work/create_struct_array.oct 
> not reloaded due to existing references
> m =
> 
>    3x1 struct array containing the fields:
> 
>      a
>      b
> 
> Seems like octave is keeping the old version in a buffer?
> 
> If I delete the .oct file and within octave try to call it, I get the 
> expected error message.  Then, recompiling uses the new version.
> 
> Any ideas?

Yes, just type:

>> clear create_struct_array; mkoctfile create_struct_array.cpp

to get a "fresh" oct file.

HTH, Kai



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Rebuild-Oct-file-does-not-change-the-executable-tp4683081p4683086.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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