在用MFC编写计算器程序时出现了这么多问题,说我没有定义等。。。可我上面定义了,不知道是怎么回事?
Compiling...MyCalculatorDlg.cppF:\C\MyCalculator\MyCalculatorDlg.cpp(206):errorC2065:...
Compiling...
MyCalculatorDlg.cpp
F:\C\MyCalculator\MyCalculatorDlg.cpp(206) : error C2065: 'UpdateDisplay' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(338) : error C2065: 'Calculate' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(383) : error C2065: 'sqrt' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(392) : error C2065: 'fabs' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(412) : error C2039: 'Calculate' : is not a member of 'CMyCalculatorDlg'
f:\c\mycalculator\mycalculatordlg.h(14) : see declaration of 'CMyCalculatorDlg'
F:\C\MyCalculator\MyCalculatorDlg.cpp(413) : error C2373: 'Calculate' : redefinition; different type modifiers
F:\C\MyCalculator\MyCalculatorDlg.cpp(415) : error C2065: 'm_operator' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(415) : error C2228: left of '.GetAt' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(418) : error C2065: 'm_first' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(418) : error C2065: 'm_second' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(425) : error C2065: 'm_display' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(425) : error C2440: '=' : cannot convert from 'char [12]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
F:\C\MyCalculator\MyCalculatorDlg.cpp(426) : error C2065: 'UpdateData' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(431) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
F:\C\MyCalculator\MyCalculatorDlg.cpp(432) : error C2065: 'm_coff' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(432) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
F:\C\MyCalculator\MyCalculatorDlg.cpp(435) : error C2039: 'UpdateDisplay' : is not a member of 'CMyCalculatorDlg'
f:\c\mycalculator\mycalculatordlg.h(14) : see declaration of 'CMyCalculatorDlg'
F:\C\MyCalculator\MyCalculatorDlg.cpp(436) : error C2373: 'UpdateDisplay' : redefinition; different type modifiers
F:\C\MyCalculator\MyCalculatorDlg.cpp(437) : error C2228: left of '.Format' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(438) : error C2228: left of '.GetLength' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(439) : error C2228: left of '.GetAt' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(439) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\MyCalculatorDlg.sbr': No such file or directory
执行 bscmake.exe 时出错.
MyCalculator.exe - 1 error(s), 0 warning(s) 展开
MyCalculatorDlg.cpp
F:\C\MyCalculator\MyCalculatorDlg.cpp(206) : error C2065: 'UpdateDisplay' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(338) : error C2065: 'Calculate' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(383) : error C2065: 'sqrt' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(392) : error C2065: 'fabs' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(412) : error C2039: 'Calculate' : is not a member of 'CMyCalculatorDlg'
f:\c\mycalculator\mycalculatordlg.h(14) : see declaration of 'CMyCalculatorDlg'
F:\C\MyCalculator\MyCalculatorDlg.cpp(413) : error C2373: 'Calculate' : redefinition; different type modifiers
F:\C\MyCalculator\MyCalculatorDlg.cpp(415) : error C2065: 'm_operator' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(415) : error C2228: left of '.GetAt' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(418) : error C2065: 'm_first' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(418) : error C2065: 'm_second' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(425) : error C2065: 'm_display' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(425) : error C2440: '=' : cannot convert from 'char [12]' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
F:\C\MyCalculator\MyCalculatorDlg.cpp(426) : error C2065: 'UpdateData' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(431) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
F:\C\MyCalculator\MyCalculatorDlg.cpp(432) : error C2065: 'm_coff' : undeclared identifier
F:\C\MyCalculator\MyCalculatorDlg.cpp(432) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
F:\C\MyCalculator\MyCalculatorDlg.cpp(435) : error C2039: 'UpdateDisplay' : is not a member of 'CMyCalculatorDlg'
f:\c\mycalculator\mycalculatordlg.h(14) : see declaration of 'CMyCalculatorDlg'
F:\C\MyCalculator\MyCalculatorDlg.cpp(436) : error C2373: 'UpdateDisplay' : redefinition; different type modifiers
F:\C\MyCalculator\MyCalculatorDlg.cpp(437) : error C2228: left of '.Format' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(438) : error C2228: left of '.GetLength' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(439) : error C2228: left of '.GetAt' must have class/struct/union type
F:\C\MyCalculator\MyCalculatorDlg.cpp(439) : fatal error C1903: unable to recover from previous error(s); stopping compilation
执行 cl.exe 时出错.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\MyCalculatorDlg.sbr': No such file or directory
执行 bscmake.exe 时出错.
MyCalculator.exe - 1 error(s), 0 warning(s) 展开
展开全部
sqrt是开根号函数,需要有头文件#include<math.h>
有些定义是需要加载对应的头文件的。
光看错误信息也看不出来具体的,可以发下代码来帮你分析问题
有些定义是需要加载对应的头文件的。
光看错误信息也看不出来具体的,可以发下代码来帮你分析问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这怎么看的出来,你的变量或者函数定义在哪儿的?是定义在类里了么?那个sqrt是函数吗?你引用了相应的头文件吗?
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这里的很多编译信息一看就明白,一项一项修改,是在改不在问
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询