help-octave
[Top][All Lists]
Advanced

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

Re: Problem with conflicting declaration


From: Jordi Gutiérrez Hermoso
Subject: Re: Problem with conflicting declaration
Date: Tue, 29 Jan 2013 13:27:25 -0500

On 29 January 2013 12:36, Reza Housseini <address@hidden> wrote:

> I'm writing an oct-file with an external library. The problem is,
> that this external library has a "typedef struct SparseMatrix" and I
> get the following error when compiling:
>
>   /usr/include/Siconos/Numerics/SparseMatrix.h:46:3: error:
> conflicting declaration ‘typedef struct SparseMatrix SparseMatrix’
>   /usr/include/octave-3.6.1/octave/dSparse.h:46:1: error: ‘class
> SparseMatrix’ has a previous declaration as ‘class SparseMatrix’
>
> How can I circumvent this problem?

If you're using both Octave and Siconos sparse matrices, there is no
easy solution. You'll have to edit the sources of Octave or the other
library to change the name of the offending collision.

Otherwise, use a less inclusive #include, e.g. don't do

    #include <octave/oct.h>

in your oct file, which includes a lot of symbols you may not want.

There have been suggestions in the past to put Octave in a its own
namespace, but there has never been sufficient traction behind that
suggestion.

- Jordi G. H.


reply via email to

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