Hi all !.
I'm doing a program that solve Bubble dynamics by a Boundary Integral Equation. I found the Seldon c++ algebra library that contains Matrix, Vector, and have iterative solvers , wich is very very useful to me in that specific program. I'm coding mostly on ObjC, with the classes that uses this library being ObjC++ (.mm files).
The files that i'm having problems with are MeshNode.h /.mm and Solver.h/.mm . I'm getting a Duplicate symbols error if I both include the principal Seldon header file "Seldon.hxx" in MeshNode.mm and Solver.mm.
I can't figure out what's happening, because I need to include that header file in these two classes's implementation files to use the library. If I remove the #import "Seldon.hxx" file in one of the two files, it compiles fine, however in that file I'm not capable to use Seldon classes.
The error is :
ld: duplicate symbol Seldon::ColMajor::GetFirst(int, int)in /Users/estin/Documents/TFC/xcode/TFC/build/TFC.build/Debug/TFC.build/Objects-normal/x86_64/Solver.o and /Users/estin/Documents/TFC/xcode/TFC/build/TFC.build/Debug/TFC.build/Objects-normal/x86_64/MeshNode.o
Here's my code:
Any ideas? thanks in advance !.
I'm doing a program that solve Bubble dynamics by a Boundary Integral Equation. I found the Seldon c++ algebra library that contains Matrix, Vector, and have iterative solvers , wich is very very useful to me in that specific program. I'm coding mostly on ObjC, with the classes that uses this library being ObjC++ (.mm files).
The files that i'm having problems with are MeshNode.h /.mm and Solver.h/.mm . I'm getting a Duplicate symbols error if I both include the principal Seldon header file "Seldon.hxx" in MeshNode.mm and Solver.mm.
I can't figure out what's happening, because I need to include that header file in these two classes's implementation files to use the library. If I remove the #import "Seldon.hxx" file in one of the two files, it compiles fine, however in that file I'm not capable to use Seldon classes.
The error is :
ld: duplicate symbol Seldon::ColMajor::GetFirst(int, int)in /Users/estin/Documents/TFC/xcode/TFC/build/TFC.build/Debug/TFC.build/Objects-normal/x86_64/Solver.o and /Users/estin/Documents/TFC/xcode/TFC/build/TFC.build/Debug/TFC.build/Objects-normal/x86_64/MeshNode.o
Here's my code:
Code:
// Solver.h
#import <Cocoa/Cocoa.h>
#import "RungeStepper.h"
#import "Entity.h"
#import "MeshNode.h"
@interface Solver : NSObject
{
NSMutableArray *entities;
// añadir parametros físicos
}
-(void) setParameters;
-(void) resetParameters;
-(void) setEntity:(Entity*) mesh;
-(void) takeStep;
-(double) calculateVolumeInEntity:(NSMutableArray*) entity;
-(double) calculatePrincipalCurvatureInNode:(MeshNode*) theNode;
-(void) solve;
//integrations
- (double) getPotentialInfluenceOnNode:(MeshNode*) nodei bySurfacesInNode:(MeshNode*) nodej;
- (double) getVelocityInfluenceOnNode:(MeshNode*) nodei bySurfacesInNode:(MeshNode*) nodej;
Code:
// Solver.mm
#define SELDON_DEBUG_LEVEL_3
#define SELDON_DEFAULT_ALLOCATOR NewAlloc
#import "Solver.h"
#import "Seldon.hxx"
-(void) takeStep
{
// this is the method where i'm going to use Seldon's classes
}
Code:
//
// MeshNode.h
#import <Cocoa/Cocoa.h>
struct Location;
@interface MeshNode : NSObject
{
double potential;
double source;
struct Location *location;
NSMutableArray *triangles; //triangles that contains this node
}
@end
Code:
//
// MeshNode.mm
#import "MeshNode.h"
#import "Seldon.hxx"
using namespace Seldon;
struct Location {
Vector<double> vertex;
};
@implementation MeshNode
-(id) init
{
if(self = [super init] )
{
location = new Location;
}
}
@end
Any ideas? thanks in advance !.