C++ pi的定义我定义了类CTextclass CText:public CDraw{...protected:const float pi;public:CText();CText(short ColorPen,short ColorBrush,short LineWide,shortLineType,short Layer,int id_only,BOOL Delete,float StartX,float StartY,float Angle1,floa

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 16:33:42

C++ pi的定义我定义了类CTextclass CText:public CDraw{...protected:const float pi;public:CText();CText(short ColorPen,short ColorBrush,short LineWide,shortLineType,short Layer,int id_only,BOOL Delete,float StartX,float StartY,float Angle1,floa
C++ pi的定义
我定义了类CText
class CText:public CDraw
{...
protected:
const float pi;
public:
CText();
CText(short ColorPen,short ColorBrush,short LineWide,short
LineType,short Layer,int id_only,BOOL Delete,float StartX,float StartY,float Angle1,float Angle2,float TextHeight,float TextWide,float OffWide,unsigned char TextFont,CString Text)
:CDraw(ColorPen,ColorBrush,LineWide,LineType,Layer,id_only,Delete),pi(float(3.14159265))
{
m_StartX=StartX;
m_StartY=StartY;
m_Angle1=Angle1;
m_Angle2=Angle2;
m_TextHeight=TextHeight;
m_TextWide=TextWide;
m_OffWide=OffWide;
m_TextLong=Text.GetLength(); //计算字符长度
c_Text=Text;
}
}
...
};
但是显示
--------------------Configuration: Draw - Win32 Debug--------------------
Compiling...
Draw.cpp
DrawDoc.cpp
DrawView.cpp
Generating Code...
Linking...
DrawDoc.obj : error LNK2001: unresolved external symbol "public: void __thiscall CDraw::DPtoVP(float,float,int *,int *)" (?DPtoVP@CDraw@@QAEXMMPAH0@Z)
DrawDoc.obj : error LNK2001: unresolved external symbol "public: int __thiscall CDraw::DLtoVL(float)" (?DLtoVL@CDraw@@QAEHM@Z)
Debug/Draw.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Draw.exe - 3 error(s), 0 warning(s)

C++ pi的定义我定义了类CTextclass CText:public CDraw{...protected:const float pi;public:CText();CText(short ColorPen,short ColorBrush,short LineWide,shortLineType,short Layer,int id_only,BOOL Delete,float StartX,float StartY,float Angle1,floa
你这个是mfc工程吧?自己还是好好看看哪个工程的错误吧,然后一点点把错误的范围缩小.已经提示你是DrawDoc文件中的这个方法CDraw::DLtoVL(float)有问题了,你自己在查查把.