[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Need help getting started with dynamically linked C++ files
From: |
John Ambrosiano |
Subject: |
Need help getting started with dynamically linked C++ files |
Date: |
Wed, 27 Nov 2002 14:54:24 -0700 |
Hello,
I've tried the oregonator example with my installation of Octave and can't
seem to get anywhere.
I've copied the example from the documentation and compiled with mkoctfile.
The code is literally:
---------------------------------------
#include <octave/oct.h>
DEFUN_DLD (oregonator, args, ,
"The `oregonator'.")
{
ColumnVector dx (3);
ColumnVector x = args(0).vector_value ();
dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0)
- 8.375e-06*pow (x(0), 2));
dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27;
dx(2) = 0.161*(x(0) - x(2));
return octave_value (dx);
}
--------------------------------------
The first thing that happens is I get is this:
cc1plus: warning: changing search order for system directory "/usr/include"
cc1plus: warning: as it has already been specified as a non-system directory
In file included from /users/rsqrd/local/include/g++-v3/backward/strstream:51,
from /usr/include/octave-2.1.34/octave/error.h:26,
from /usr/include/octave-2.1.34/octave/ov-base.h:38,
from /usr/include/octave-2.1.34/octave/ov-fcn.h:36,
from /usr/include/octave-2.1.34/octave/ov-builtin.h:32,
from /usr/include/octave-2.1.34/octave/defun-int.h:28,
from /usr/include/octave-2.1.34/octave/defun-dld.h:30,
from /usr/include/octave-2.1.34/octave/oct.h:33,
from oregonator.cc:1:
/users/rsqrd/local/include/g++-v3/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one deprecated or antiquated
header. Please consider using one of the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the <X> header
for the <X.h> header for C++ includes, or <sstream> instead of the
deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
oregonator.cc: In function `octave_value_list Foregonator(const
octave_value_list&, int)':
oregonator.cc:8: conversion from `Array<double>' to non-scalar type `
ColumnVector' requested
-----------------------------------------------
If I comment out the offending lines (all except the declaration of dx and
the return) just to get it to compile, I get a .oct file, but when I try to
run in octave:
--------------------------------
octave> oregonator([1,2,3],0)
error: `oregonator' undefined near line 4 column 1
error: evaluating index expression near line 4, column 1
octave>
-------------------------
I checked that my version octave-2.1.34 supports dynamic linking and it does.
What could be wrong?
-------------------------------------------------------------
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
-------------------------------------------------------------
- Need help getting started with dynamically linked C++ files,
John Ambrosiano <=