题目
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 "
我定义了类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 "
提问时间:2020-05-20
答案
你这个是mfc工程吧?自己还是好好看看哪个工程的错误吧,然后一点点把错误的范围缩小.已经提示你是DrawDoc文件中的这个方法CDraw::DLtoVL(float)有问题了,你自己在查查把.
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
- 1how long does spring festival ------?15days.a.go b.take c.last d.make
- 2梁能组什么词
- 3He was only two years old then翻译- =主要是那个then
- 4求长度,重量等转换的表格?比如1米=100厘米+1000毫米.1公斤=2市斤=
- 5客车从甲地开往乙地需10小时,比货车从乙地开往甲地所需要的时间少1/6,1货车从乙地开往甲地需要多少小时
- 6《山中杂记》中"屏息静立"是什么意思?
- 7look,someone __________ on the ground.what is t
- 8关于水声的二字词语
- 9分式(x+m)/(n-2x),当x=2时,无意义,当x=-3时,其值为0.求m+n的值
- 10流星真的能帮人们实现愿望吗?
热门考点