help-octave
[Top][All Lists]
Advanced

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

Compiling old OCT files


From: E. Joshua Rigler
Subject: Compiling old OCT files
Date: Thu, 09 Sep 2004 11:59:54 -0600

I recently decided to dust off some old DLD functions I developed a few
years ago using Octave 2.1.34 (or so), and Redhat linux 7.2.  Now I use
Octave 2.1.57 (self-compiled with Octave Forge) on Enterprise Redhat,
and I get two consistent errors that didn't used to occur.

1) Every time I try to return a null matrix after printing out an error
message (i.e.,


[376]  error ("Too many inputs.\n");
[377]  return retval = Matrix (0,0);


), I get this error when I use mkoctfile:


test.cc:377: no match for `octave_value_list& = Matrix' operator
/usr/local/include/octave-2.1.57/octave/oct-obj.h:78: candidates are:
   octave_value_list& octave_value_list::operator=(const octave_value_list&)


2) I am having problems with strings.  Sadly, I don't really remember
why I coded things the way I did three years ago.  I think I took some
hints from JWE.  Everything worked, but I didn't really understand what
I was doing at the time.  For instance, the following code used to work
for copying a "const char*" value to a "char*" because the C library
function I was writing a wrapper for couldn't handle the former:


[488]  char *fmt = new char [args(1).string_value ().length () +1];
[489]  args(1).string_value ().copy (fmt, string::npos);
[490]  fmt [args(1).string_value ().length ()] = '\0';


Now, I get the following error:


  test.cc:489: `string' undeclared (first use this function)
  test.cc:489: (Each undeclared identifier is reported only once for each
     function it appears in.)
  test.cc:489: syntax error before `::' token


This is, in fact, the first time I've played with any C++ code in over
three years, so for all I know, my questions may not even be specific to
Octave.  I did browse quickly through Da Coda Al Fine, but found nothing
that promised any help.  Any hints would be most appreciated.  Thanks.

-EJR



-------------------------------------------------------------
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]