出现编译错误请求帮忙解决
我用C++语言编写了如下程序,编译中出现错误信息:try error LNK2019: 无法解析的外部符号 "public: __thiscall ChebyshevPolynomial::~ChebyshevPolynomial(void)" (??1ChebyshevPolynomial@@QAE@XZ) ,该符号在函数 "public: double __thiscall ChebyshevPolynomial::ChebyshevOneDifferential(void)" (?ChebyshevOneDifferential@ChebyshevPolynomial@@QAENXZ) 中被引用
怎么解决?请高手帮忙了。
源程序为:
#include "stdafx.h"
#include<cmath>
using namespace std;
class ChebyshevPolynomial
{
private:
int iDegree;
int nOrder;
double dxVariable;
public:
ChebyshevPolynomial(int iLocal,int nLocal,double xLocal);
double ChebyshevFunction( );
double ChebyshevLimitedPoint( );
double ChebyshevOneDifferential( );
~ChebyshevPolynomial( );
};
ChebyshevPolynomial::ChebyshevPolynomial(int iLocal,int nLocal,double xLocal)
{
iDegree=iLocal;
nOrder=nLocal;
dxVariable=xLocal;
}
double ChebyshevPolynomial::ChebyshevFunction( )
{
return(cos(iDegree*acos(dxVariable)));
}
double ChebyshevPolynomial::ChebyshevLimitedPoint( )
{
double pi=3.1415926;
return(-cos(iDegree*pi/nOrder));
}
double ChebyshevPolynomial::ChebyshevOneDifferential( )
{
double ci,cj,xVariable,TjXi,TjX,hk_x(0);
int j;
if(iDegree==0||iDegree==nOrder)
ci=2;
else
ci=1;
xVariable=ChebyshevLimitedPoint( );
for(j=0;j<=nOrder;j++)
{
if(j==0||j==nOrder)
cj=2;
else
cj=1;
ChebyshevPolynomial(j,nOrder,xVariable);
TjXi=ChebyshevFunction( );
ChebyshevPolynomial(j,nOrder,dxVariable);
TjX=ChebyshevFunction( );
hk_x+=TjXi*TjX/cj;
}
return(2*hk_x/nOrder/ci);
}
int _tmain(int argc, _TCHAR* argv[])
{
ChebyshevPolynomial Chebyshev(1,4,0.5);
cout<<"Chebyshev.ChebyshevFunction( )"<<Chebyshev.ChebyshevFunction( )<<endl;
cout<<"Chebyshev.ChebyshevLimitedPoint( )"<<Chebyshev.ChebyshevLimitedPoint( )<<endl;
cout<<"Chebyshev.ChebyshevOneDifferential( )"<<Chebyshev.ChebyshevOneDifferential( )<<endl;
return 0;
}