Seldon - duplicate symbol

Hi,

I have troubles compiling the code I write.
My code is spread across several header and source files. When I include <Seldon.hxx> in one of the header files (I have to pass a matrix by reference) I end-up with an error

Building target: seldon
Invoking: MacOS X C++ Linker
g++ -o "seldon" ./main.o ./matrix.o -llapack -lblas -lcblas
ld: duplicate symbol Seldon::SeldonTranspose::SeldonTranspose(int)in ./matrix.o and ./main.o for architecture x86_64
collect2: ld returned 1 exit status
make: *** [seldon] Error 1

Here are the source files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * main.cpp
 */

#define SELDON_DEBUG_LEVEL_3

#include <Seldon.hxx>
using namespace Seldon;

#include "matrix.h"

int main()
{

  TRY;

  Matrix<double> A(3, 3);
  Vector<double> U, V;

  A.SetIdentity();
  A(0, 1) = -1.0;

  U.Reallocate(A.GetN());
  U.Fill();

  U.Print();

  V.Reallocate(A.GetM());
  Mlt(2.0, A, U, V);

  cout << V << endl;

  aaa(A);

  END;

  return 0;

}


1
2
3
4
5
6
7
8
9
10
11
12
/*
 * matrix.h
 */

#ifndef MATRIX_H_
#define MATRIX_H_

#include <Seldon.hxx>

void aaa(Seldon::Matrix<double>& A);

#endif /* MATRIX_H_ */ 

1
2
3
4
5
6
7
8
9
10
11
12
13
/*
 * matrix.cpp
 */

#include <iostream>
#include <Seldon.hxx>
#include "matrix.h"

void aaa(Seldon::Matrix<double>& A)
{
    std::cout << "Matrix function called\n";
    std::cout << A;
}
Could you please post Seldon.hxx?
That is a library, available here http://seldon.sourceforge.net/
Topic archived. No new replies allowed.