由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Help: Another C++ compilation error on GCC
相关主题
C++ question问一下可能性,MingW生成的DLL和MSVC生成的DLL两个线程同步
C arrayC++ with gtkmm
有谁知道怎么把matlab和VC联接着一起用? (转载)现在哪个C++ IDE比较好?
C++ help: 一个multiple definition problem.lifeaswater, please answer question in post 5700
How to use volatile in c++?Qt/Windows 开源版本将支持 VS Express
面试题还是不太清楚怎么回答。尤其是8,我用MSVC试了一下,没有问题啊。sscanf problem in MSVC 7
一道c++的考古题听说pointer to member function只支持最多128个virtual functi
[合集] 面试题还是不太清楚怎么回答。尤其是8,我用MSVC试了一下,没有遇到 Qt 下undefined reference to "func" 错误
相关话题的讨论汇总
话题: mathtools话题: source话题: home话题: gcc话题: c++
进入Programming版参与讨论
1 (共1页)
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
2
no code, no truth
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()?

1 (共1页)
进入Programming版参与讨论
相关主题
遇到 Qt 下undefined reference to "func" 错误How to use volatile in c++?
C问题,被64bit iPhone搞晕了面试题还是不太清楚怎么回答。尤其是8,我用MSVC试了一下,没有问题啊。
才发现gcc的parallel mode一道c++的考古题
white board coding的时候如果遇到hash table[合集] 面试题还是不太清楚怎么回答。尤其是8,我用MSVC试了一下,没有
C++ question问一下可能性,MingW生成的DLL和MSVC生成的DLL两个线程同步
C arrayC++ with gtkmm
有谁知道怎么把matlab和VC联接着一起用? (转载)现在哪个C++ IDE比较好?
C++ help: 一个multiple definition problem.lifeaswater, please answer question in post 5700
相关话题的讨论汇总
话题: mathtools话题: source话题: home话题: gcc话题: c++