help-octave
[Top][All Lists]
Advanced

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

Unidentified subject!


From: Charles Fox
Subject: Unidentified subject!
Date: Wed, 30 Jun 2004 22:04:04 +0100 (BST)

Hi guys, I'm having problems using the oct.h library for cpp programs.  I
got this demo code from the octave wiki and I cant get it to compile.  The
command I use is:
  gcc test.cpp -L/usr/lib/octave-2.1.44/
But I get the error messages shown below.  I'm sure this is something
really obvious but I've spent all day tryign to find what's wrong!
I've also tried 
  gcc test.cpp -liboctave
with similar effects.


#include <iostream>
#include <octave-2.1.44/octave/oct.h>

int main(void) {
     std::cout << "Hello Octave world!\n";
     const int size = 2;
     Matrix a_matrix = Matrix(size, size);
     for (int row = 0; row < size; ++row) {
         for (int column = 0; column < size; ++column)  {
             a_matrix(row, column) = (row + 1)*10 + (column + 1);
         }
     }
     std::cout << a_matrix;
     return 0;
}

ERROR MESSAGE:

In file included from /usr/include/octave/ov-typeinfo.h:34,
                 from /usr/include/octave/ov-base.h:40,
                 from /usr/include/octave/ov-fcn.h:36,
                 from /usr/include/octave/ov-builtin.h:32,
                 from /usr/include/octave/defun-int.h:28,
                 from /usr/include/octave/defun-dld.h:30,
                 from /usr/include/octave-2.1.44/octave/oct.h:35,
                 from test.cpp:4:
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3(T*, int,
int, int)':
/usr/include/octave/Array3.h:49: error: there are no arguments to
`get_size' that depend on a template parameter, so a declaration of
`get_size' must be available
/usr/include/octave/Array3.h:49: error: (if you use `-fpermissive', G++
will accept your code, but allowing the use of an undeclared name is
deprecated)
/usr/include/octave/Array3.h:51: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h:51: error: (Each undeclared identifier is
reported only once for each function it appears in.)
/usr/include/octave/Array3.h:53: error: there are no arguments to
`set_max_indices' that depend on a template parameter, so a declaration of
`set_max_indices' must be available
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3()':
/usr/include/octave/Array3.h:60: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h:62: error: there are no arguments to
`set_max_indices' that depend on a template parameter, so a declaration of
`set_max_indices' must be available
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3(int, int,
int)':
/usr/include/octave/Array3.h:65: error: there are no arguments to
`get_size' that depend on a template parameter, so a declaration of
`get_size' must be available
/usr/include/octave/Array3.h:67: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h:69: error: there are no arguments to
`set_max_indices' that depend on a template parameter, so a declaration of
`set_max_indices' must be available
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3(int, int,
int, const T&)':
/usr/include/octave/Array3.h:74: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h:76: error: there are no arguments to
`set_max_indices' that depend on a template parameter, so a declaration of
`set_max_indices' must be available
/usr/include/octave/Array3.h: In copy constructor `Array3<T>::Array3(const
Array3<T>&)':
/usr/include/octave/Array3.h:81: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h:83: error: there are no arguments to
`set_max_indices' that depend on a template parameter, so a declaration of
`set_max_indices' must be available
/usr/include/octave/Array3.h: In member function `Array3<T>&
Array3<T>::operator=(const Array3<T>&)':
/usr/include/octave/Array3.h:90: error: `rep' undeclared (first use this
function)
/usr/include/octave/Array3.h:93: error: `d1' undeclared (first use this
function)
/usr/include/octave/Array3.h:94: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T& Array3<T>::xelem(int,
int, int)':
/usr/include/octave/Array3.h:105: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T Array3<T>::xelem(int,
int, int) const':
/usr/include/octave/Array3.h:106: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T&
Array3<T>::checkelem(int, int, int)':
/usr/include/octave/Array3.h:114: error: `d1' undeclared (first use this
function)
/usr/include/octave/Array3.h:114: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T& Array3<T>::elem(int,
int, int)':
/usr/include/octave/Array3.h:123: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T
Array3<T>::checkelem(int, int, int) const':
/usr/include/octave/Array3.h:133: error: `d1' undeclared (first use this
function)
/usr/include/octave/Array3.h:133: error: `d2' undeclared (first use this
function)
/usr/include/octave/Array3.h: In member function `T Array3<T>::elem(int,
int, int) const':
/usr/include/octave/Array3.h:141: error: `d2' undeclared (first use this
function)
In file included from /usr/include/octave/ov-dld-fcn.h:32,
                 from /usr/include/octave/defun-int.h:29,
                 from /usr/include/octave/defun-dld.h:30,
                 from /usr/include/octave-2.1.44/octave/oct.h:35,
                 from test.cpp:4:
/usr/include/octave/oct-shlib.h:28:22: oct-time.h: No such file or
directory
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3(int, int,
int, const T&) [with T = octave_value (*)(const octave_value&, const
octave_value&)]':
/usr/include/octave/ov-typeinfo.h:129:   instantiated from here
/usr/include/octave/Array3.h:76: error: `set_max_indices' undeclared
(first use this function)
/usr/include/octave/Array3.h: In constructor `Array3<T>::Array3(int, int,
int, const T&) [with T = octave_value (*)(octave_value&, const
octave_value_list&, const octave_value&)]':
/usr/include/octave/ov-typeinfo.h:129:   instantiated from here
/usr/include/octave/Array3.h:76: error: `set_max_indices' undeclared
(first use this function)




Charles Fox
DPhil student
Pattern Analysis & Machine Learning
Robotics Research Group
Dept. of Engineering Science
University of Oxford, UK
www.robots.ox.ac.uk/~charles



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