3.4.4 vs 3.2.5 ; fabs: cant use as a function..
Ming-Xiang Fu
deadly@cmlab.csie.ntu.edu.tw
Thu Jul 28 04:16:00 GMT 2005
hi, I am having some problem to compile a code by gcc 3.4.4 which is
successfully compiled in gcc 3.2.5.
At the begining, it complains about abs(float) is ambiguous..and sin(), cos()
not declares.
And then, I include <cmath>, resolve some problem, and new problem occurs.
" ` fabs' cannot be used as a function "
please give me some guide, I will be appreciate about that.
Thanks anyway. :)
RedMo
part of src code as below.
------------------------------------------------------------------------------------------------------------------------------------
// GlobalObject.cpp: implementation of the CGlobalObject class.
//
//////////////////////////////////////////////////////////////////////
#include "GlobalObject.h"
#include <iomanip>
#include <math.h>
#include "../../Node/DEBUG.H"
using namespace std;
void VsMathObject::Evaluate(int member, VsValue& value, VsExprList &args,
VsFunctionCall *parent)
{
switch(member)
{
case fabs:
value.SetNumber( fabs(arg0.GetNumber()) );
// arg0.GetNumber() returns a float number.
break;
case ffabs:
value.SetNumber( fabs(arg0.GetNumber()) );
break;
case facos:
value.SetNumber( acos(arg0.GetNumber()) );
break;
case fasin:
value.SetNumber( asin(arg0.GetNumber()) );
break;
default:
ASSERT(false);
}
}
---------------------------------------------------------------------------------------------------------------------------
--
Communication and Multimedia Laboratory
Dept. of Computer Science and Information Engineering, NTU
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GlobalObject.h
Type: text/x-chdr
Size: 6152 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20050728/8869b5ef/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GlobalObject.cpp
Type: text/x-c++src
Size: 26091 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20050728/8869b5ef/attachment-0001.bin>
More information about the Gcc-help
mailing list