James
2010-07-07 05:19:18 UTC
namespace normalization{
float tstar;
float bstar;
float xstar;
float vstar;
float estar;
float pstar;
void set_norm(float mpart, float q)
{
float omega = IMF::particleFunctions::omega(mpart, q);
IMF::normalization::tstar = (2.0*IMF::constants::pi)/omega;
IMF::normalization::xstar = IMF::constants::rsun;
IMF::normalization::vstar = (IMF::constants::c)/1000.0;
IMF::normalization::bstar = IMF::b0/100.0;
IMF::normalization::estar = (bstar*vstar)/IMF::constants::c;
IMF::normalization::pstar = mpart*vstar;
}
}
I can compile all my source files up to the point where i get .o files, but I can't link these files, at that point I get an error message saying multiple definition of the variables in the above namespace.
I think the problem may lie in my header file, here is the contents of the header file for the namespace listed above:
namespace normalization{
//float tstar;
//float bstar;
//float xstar;
//float vstar;
//float estar;
//float pstar;
void set_norm(float mpart, float q);
}
please could someone help me to fix this bug? If you need any further information I will try and provide it.