T
Torben Laursen
I have tryed to use the cli switch on my C++ code
It is a large C++ project compiled to a dll that I call from a number of
different interfaces C++, VBA and C#
However when I try to compile with the CLI switch I get this error:
Error 3 error LNK2022: metadata operation failed (8013118D) : Inconsistent
layout information in duplicated types (Equia.cPhysical): (0x02000059).
Physical_Base.obj
The code that makes the error is very simply and I just dont see what is
wrong, can any one help me? The code is below
Thanks Torben
///Header file
#ifndef Physical_BaseH
#define Physical_BaseH
#include "Utility.h"
namespace Equia
{
class cPhysical_Base
{
public:
cPhysical_Base(void);
void Clear(void);
void Resize(const int &N);
std::vector<double> dni;
double value;
double dT;
double dP;
};
class cPhysical : public cPhysical_Base
{
public:
cPhysical(void);
void Clear(void);
void Resize(const int &N);
cPhysical_Base Residual;
cPhysical_Base Ideal;
};
class cPhysical_All
{
public:
cPhysical_All(void);
void Clear(void);
void Resize(const int &N);
cPhysical H;
cPhysical S;
cPhysical G;
cPhysical Cv;
cPhysical Cp;
};
} //namespace Equia
#endif
Code file:
#pragma hdrstop
#include "Physical_Base.h"
Equia::cPhysical_Base::cPhysical_Base(void)
{
Clear();
}
void Equia::cPhysical_Base::Clear(void)
{
value = 0.0;
dT = 0.0;
dP = 0.0;
for(unsigned int i=0; i<dni.size(); ++i)
dni = 0.0;
}
void Equia::cPhysical_Base::Resize(const int &N)
{
dni.resize(N);
}
Equia::cPhysical::cPhysical(void)
{
Clear();
}
void Equia::cPhysical::Clear(void)
{
cPhysical_Base::Clear();
Residual.Clear();
Ideal.Clear();
}
void Equia::cPhysical::Resize(const int &N)
{
cPhysical_Base::Resize(N);
Residual.Resize(N);
Ideal.Resize(N);
}
Equia::cPhysical_All::cPhysical_All(void)
{
}
void Equia::cPhysical_All::Clear(void)
{
H.Clear();
S.Clear();
G.Clear();
Cv.Clear();
Cp.Clear();
}
void Equia::cPhysical_All::Resize(const int &N)
{
H.Resize(N);
S.Resize(N);
G.Resize(N);
Cv.Resize(N);
Cp.Resize(N);
}
It is a large C++ project compiled to a dll that I call from a number of
different interfaces C++, VBA and C#
However when I try to compile with the CLI switch I get this error:
Error 3 error LNK2022: metadata operation failed (8013118D) : Inconsistent
layout information in duplicated types (Equia.cPhysical): (0x02000059).
Physical_Base.obj
The code that makes the error is very simply and I just dont see what is
wrong, can any one help me? The code is below
Thanks Torben
///Header file
#ifndef Physical_BaseH
#define Physical_BaseH
#include "Utility.h"
namespace Equia
{
class cPhysical_Base
{
public:
cPhysical_Base(void);
void Clear(void);
void Resize(const int &N);
std::vector<double> dni;
double value;
double dT;
double dP;
};
class cPhysical : public cPhysical_Base
{
public:
cPhysical(void);
void Clear(void);
void Resize(const int &N);
cPhysical_Base Residual;
cPhysical_Base Ideal;
};
class cPhysical_All
{
public:
cPhysical_All(void);
void Clear(void);
void Resize(const int &N);
cPhysical H;
cPhysical S;
cPhysical G;
cPhysical Cv;
cPhysical Cp;
};
} //namespace Equia
#endif
Code file:
#pragma hdrstop
#include "Physical_Base.h"
Equia::cPhysical_Base::cPhysical_Base(void)
{
Clear();
}
void Equia::cPhysical_Base::Clear(void)
{
value = 0.0;
dT = 0.0;
dP = 0.0;
for(unsigned int i=0; i<dni.size(); ++i)
dni = 0.0;
}
void Equia::cPhysical_Base::Resize(const int &N)
{
dni.resize(N);
}
Equia::cPhysical::cPhysical(void)
{
Clear();
}
void Equia::cPhysical::Clear(void)
{
cPhysical_Base::Clear();
Residual.Clear();
Ideal.Clear();
}
void Equia::cPhysical::Resize(const int &N)
{
cPhysical_Base::Resize(N);
Residual.Resize(N);
Ideal.Resize(N);
}
Equia::cPhysical_All::cPhysical_All(void)
{
}
void Equia::cPhysical_All::Clear(void)
{
H.Clear();
S.Clear();
G.Clear();
Cv.Clear();
Cp.Clear();
}
void Equia::cPhysical_All::Resize(const int &N)
{
H.Resize(N);
S.Resize(N);
G.Resize(N);
Cv.Resize(N);
Cp.Resize(N);
}