kirill_igum
06-20-2010, 07:23 PM
Hi, i'm using NR3(c++) to solve ode using rkDopr853 method
i call integration in bratoket.cc:
Output out(duration-1);
rhs_corr d(x0);
Odeint<StepperDopr853<rhs_corr> > ode(ystart,x1,x2,atol,rtol,h1,hmin,out,d);
ode.integrate();
bratoket.h contains:
#include "nr3.h"
#include "stepper.h"
#include "odeint.h"
#include "stepperdopr853.h"
no other file contains
#include "stepperdopr853.h"
when i link all the .o files, i get errors like this one
...
bratoket.o:(.rodata+0xa18): multiple definition of `Dopr853_constants::d76'
main.o:(.rodata+0x480): first defined here
bratoket.o:(.rodata+0xa20): multiple definition of `Dopr853_constants::d77'
main.o:(.rodata+0x488): first defined here
bratoket.o:(.rodata+0xa28): multiple definition of `Dopr853_constants::d78'
main.o:(.rodata+0x490): first defined here
bratoket.o:(.rodata+0xa30): multiple definition of `Dopr853_constants::d79'
main.o:(.rodata+0x498): first defined here
bratoket.o:(.rodata+0xa38): multiple definition of `Dopr853_constants::d710'
main.o:(.rodata+0x4a0): first defined here
bratoket.o:(.rodata+0xa40): multiple definition of `Dopr853_constants::d711'
main.o:(.rodata+0x4a8): first defined here
bratoket.o:(.rodata+0xa48): multiple definition of `Dopr853_constants::d712'
main.o:(.rodata+0x4b0): first defined here
bratoket.o:(.rodata+0xa50): multiple definition of `Dopr853_constants::d713'
main.o:(.rodata+0x4b8): first defined here
bratoket.o:(.rodata+0xa58): multiple definition of `Dopr853_constants::d714'
main.o:(.rodata+0x4c0): first defined here
bratoket.o:(.rodata+0xa60): multiple definition of `Dopr853_constants::d715'
main.o:(.rodata+0x4c8): first defined here
bratoket.o:(.rodata+0xa68): multiple definition of `Dopr853_constants::d716'
main.o:(.rodata+0x4d0): first defined here
make: *** [main] Error 1
errors come up for all dopr853 constants and other files between main and bratoket.
the errors don't come up if i use StepperBS or StepperDopr5. the errors also don't come up if i make the whole program with dopr5 and then change to dopr853 in the bratoket.h and .cc files and then make again.
putiing #ifndef ... doesn't help
can someone c a solution?
--Kirill
i call integration in bratoket.cc:
Output out(duration-1);
rhs_corr d(x0);
Odeint<StepperDopr853<rhs_corr> > ode(ystart,x1,x2,atol,rtol,h1,hmin,out,d);
ode.integrate();
bratoket.h contains:
#include "nr3.h"
#include "stepper.h"
#include "odeint.h"
#include "stepperdopr853.h"
no other file contains
#include "stepperdopr853.h"
when i link all the .o files, i get errors like this one
...
bratoket.o:(.rodata+0xa18): multiple definition of `Dopr853_constants::d76'
main.o:(.rodata+0x480): first defined here
bratoket.o:(.rodata+0xa20): multiple definition of `Dopr853_constants::d77'
main.o:(.rodata+0x488): first defined here
bratoket.o:(.rodata+0xa28): multiple definition of `Dopr853_constants::d78'
main.o:(.rodata+0x490): first defined here
bratoket.o:(.rodata+0xa30): multiple definition of `Dopr853_constants::d79'
main.o:(.rodata+0x498): first defined here
bratoket.o:(.rodata+0xa38): multiple definition of `Dopr853_constants::d710'
main.o:(.rodata+0x4a0): first defined here
bratoket.o:(.rodata+0xa40): multiple definition of `Dopr853_constants::d711'
main.o:(.rodata+0x4a8): first defined here
bratoket.o:(.rodata+0xa48): multiple definition of `Dopr853_constants::d712'
main.o:(.rodata+0x4b0): first defined here
bratoket.o:(.rodata+0xa50): multiple definition of `Dopr853_constants::d713'
main.o:(.rodata+0x4b8): first defined here
bratoket.o:(.rodata+0xa58): multiple definition of `Dopr853_constants::d714'
main.o:(.rodata+0x4c0): first defined here
bratoket.o:(.rodata+0xa60): multiple definition of `Dopr853_constants::d715'
main.o:(.rodata+0x4c8): first defined here
bratoket.o:(.rodata+0xa68): multiple definition of `Dopr853_constants::d716'
main.o:(.rodata+0x4d0): first defined here
make: *** [main] Error 1
errors come up for all dopr853 constants and other files between main and bratoket.
the errors don't come up if i use StepperBS or StepperDopr5. the errors also don't come up if i make the whole program with dopr5 and then change to dopr853 in the bratoket.h and .cc files and then make again.
putiing #ifndef ... doesn't help
can someone c a solution?
--Kirill