y****e 发帖数: 23939 | 1 In file included from /usr/include/math.h:70,
from /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../
include/c++/3.4.4/cmath:52,
from /home/g/G/source/MathTools/Vector3DTemplate.h:5,
from /home/g/G/source/MathTools/Vector3D.h:4,
from /home/g/G/source/MathTools/DataStructures.h:4,
from /home/g/G/source/MathTools/Combinatorics.h:4,
from /home/g/G/source/MathTools/MathTools.cpp:8:
/usr/include/bits | t****t 发帖数: 6806 | | t****t 发帖数: 6806 | 3 come on, this is obviously a compile error. not even in link stage. | h********g 发帖数: 116 | 4 code
【在 y****e 的大作中提到】 : In file included from /usr/include/math.h:70, : from /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../ : include/c++/3.4.4/cmath:52, : from /home/g/G/source/MathTools/Vector3DTemplate.h:5, : from /home/g/G/source/MathTools/Vector3D.h:4, : from /home/g/G/source/MathTools/DataStructures.h:4, : from /home/g/G/source/MathTools/Combinatorics.h:4, : from /home/g/G/source/MathTools/MathTools.cpp:8: : /usr/include/bits
| y****e 发帖数: 23939 | 5 #include
template Vector3DTemplate Vector3DTemplate::Rotate(
Vector3DTemplate axis, double angle) {
double r = angle;
T a = axis.values[0];
T b = axis.values[1];
T c = axis.values[2];
T q0 = (T)( std::cos(r/2.0) );
T q1 = (T)( std::sin(r/2.0)* a );
T q2 = (T)( std::sin(r/2.0)* b );
T q3 = (T)( std::sin(r/2.0)* c );
...........
}
The code looks OK. The problem is if I exteact this file and compile this it
in a pet project, it is fine. But | t****t 发帖数: 6806 | 6 the error is in mathcall.h, so we don't want your sin and cos code. if my
mathcall.h is the same as yours, then line 310 is the definition of round().
did you redefine round()?
【在 y****e 的大作中提到】 : #include : template Vector3DTemplate Vector3DTemplate::Rotate( : Vector3DTemplate axis, double angle) { : double r = angle; : T a = axis.values[0]; : T b = axis.values[1]; : T c = axis.values[2]; : : T q0 = (T)( std::cos(r/2.0) ); : T q1 = (T)( std::sin(r/2.0)* a );
| y****e 发帖数: 23939 | 7 Thank you very much, thrust!
That IS the problem. This code is ported from MSVC. They define a macro
round(). I remove it and use the function round() available, then the
problem gone.
).
【在 t****t 的大作中提到】 : the error is in mathcall.h, so we don't want your sin and cos code. if my : mathcall.h is the same as yours, then line 310 is the definition of round(). : did you redefine round()?
|
|