From help-octave-request at bevo dot che dot wisc dot edu Mon Aug 27 20:10:34 2001 Subject: Re: troubles with mkoctfiles From: "John W. Eaton" To: teg at redhat dot com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) Cc: Istvan Albert , help-octave@bevo.che.wisc.edu Date: Mon, 27 Aug 2001 20:10:21 -0500 On 27-Aug-2001, Trond Eivind =?iso-8859-1?Q?Glomsr=F8d?= wrote: | Istvan Albert writes: | | > Hello, | > | > I have recently started using Octave 2.1.33 (RedHat linux) it works great | > but I am having troubles with the mkoctfile script. | > | > This is the result of compiling hello.cc | > | > mkoctfile -v hello.cc | > c++ -c -fPIC -I/usr/include/octave-2.1.33 -I/usr/include/octave-2.1.33/octave -I/usr/include -mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates -O2 -march=i386 -mcpu=i686 hello.cc -o hello.o | > hello.cc: In function `octave_value_list Fhello (const | > octave_value_list &, int)': | > hello.cc:94: no matching function for call to `octave_value::print ()' | > /usr/include/octave-2.1.33/octave/ov.h:479: candidates are: void octave_value::print (ostream &, bool = false) const | > | > now if I comment out the tmp.print line in hello.cc the script | > compiles and runs fine in Octave (doesn't output the arguments | > anymore of course). What could be the problem here? ( Although I | > have programmed in C I'm not used to C++ syntax so it is difficult | > for me to guess why this methods is not seen) | > | > When I try to compile the other script (oregonator.cc), I get | > | > oregonator.cc: In function `octave_value_list Foregonator (const | > octave_value_list &, int)': | > oregonator.cc:15: conversion from `Array' to non-scalar type | > `ColumnVector' requested | | gcc 2.96RH (and gcc 3) both have much stronger demands on typing and | other aspects of C++ code, which is why you're seeing these messages. These problems are not due to gcc 2.96 doing more awesome and anal typechecking, but because of some internal changes in the way Octave works that were not accounted for in the examples. For hello.cc, you need tmp.print (octave_stdout); instead of tmp.print (); because now the stream argument is required. For oregonator.cc, you need ColumnVector x (args(0).vector_value ()); instead of ColumnVector x = args(0).vector_value (); because (for real-valued Matrix objects) vector_value now produces an Array object instead of a ColumnVector object. The examples are fixed in the current CVS sources. jwe ------------------------------------------------------------- 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 -------------------------------------------------------------