This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC 2.95.2
- To: gcc at gcc dot gnu dot org
- Subject: GCC 2.95.2
- From: c958179 at student dot dtu dot dk
- Date: Mon, 4 Dec 2000 12:26:42 +0100 (MET)
I am using gcc-2.95.2 to compile a c++ program. The program has been
compiled and run with a egcs-1.1.2 compiler before.But when I try to
compile the same program with gcc-2.95.2 I get errors like:
ANCI C++ forbids declaration 'xxxx' with no type.
and
field 'xxxx' has incomplete type.
What is the meaning of these errors?
In the source code(RigidBodyTrans.H) I am having the following
errors:
field 'rotate' has incomplete type
field 'translate' has incomplete type
And in the source code RAPID_PRIVATE, I am getting this error:
ANCI C++ forbids declaration 'RAPID_Collide' with no type.
Thank you
Sc.
// these are the data elements and procedure declarations necessary for
// the RAPID_model class, but which we don't want visible in the
// RAPID.H file, which the client programmer sees.
// This is an unconventional use of '#include' directive, but it reduces
// conceptual overhead for the client.
box *b;
int num_boxes_alloced;
tri *tris;
int num_tris;
int num_tris_alloced;
int build_state;
int build_hierarchy();
friend RAPID_Collide(double R1[3][3], double T1[3],
double s1, RAPID_model *RAPID_model1,
double R2[3][3], double T2[3],
double s2, RAPID_model *RAPID_model2,
int flag);
// RigidBodyTrans.H
// different ways of representing and dealing with rigid transformations
// there are many different representations here.
// Transform - a rotation matrix and a translation vector
// these are input and output in the style of geomview,
// where the rotation matrix and translation are put together
// in a 4x4 matrix, and the matrix is written out transposed
#ifndef RIGIDBODYTRANS_H
#define RIGIDBODYTRANS_H
// some convenient routines on vectors-
/// magnitude of a vector
double v3mag(v3 const &);
// distance between two points.
double v3dist(v3 const &,v3 const &);
#define CONFIG TransQuat
// the highest possible degree of the bezier curve.
#define MAXDEGREE 10
/// the radius of the robot (used to normalize a rotation to linear distance)
extern double rho;
extern void setrho(double);
class TransQuat;
/// matrix-represented transforms. Used to talk to geomview
class Transform
{
public:
Transform(void){};
Transform(Transform const &t)
: rotate(t.rotate),translate(t.translate){};
Transform(TransQuat &tq);
// Transform(Euler &e);
m33 rotate;
v3 translate;
v3 apply(v3 const &) const; // apply this transform to the given point
void apply_to(v3 &);
void read(istream &);
void write(ostream &);
// specific functions:
void identity(void);
};
/// transforms represented by a translation and a quaternion.
class TransQuat
{
private:
#ifdef ALLOW2D
static bool constrained;
static int c_axis;
static double c_loc;
#endif
public:
TransQuat(void){};
TransQuat(Transform const &t){ set(t); }
TransQuat(TransQuat const &tq)
: translate(tq.translate)
{
memcpy(q,tq.q,4*sizeof(double));
}
v3 translate;
double q[4];
void set(Transform const &t);
bool read(istream &);
bool write(ostream &);
void apply_to(v3 &) const;
void apply_to(TransQuat &) const;
/// return the given point with the transformation applied to it.
v3 apply(v3 const &) const;
#ifdef ALLOW2D
/** set static variables related to 2D planning. This does _NOT_
set actual translation constraints, although the translational
constraints are passed to this function. */
static void set_constraint(v3&,v3&);
#endif
/** linearly interpolate between the given TransQuat's, creating
a discretized path stored in list */
static void interpolate(TransQuat const &from,TransQuat const &to,
int steps,TransQuat *list);
/** perform a single linear interpolation between the given
TransQuat's */
void interpolate(TransQuat const &from,TransQuat const &to,
double alpha);
double dist_abs(TransQuat const&) const;
double dist_rel(TransQuat const&) const;
double dist_euc(TransQuat const&) const;
void setrandom(v3 const &lower,v3 const &upper);
// create a random but small magnitude configuration to be applied
// as an incremental step
// the argument is a (somewhat approximate) stepsize
void setrandomDir(double);
void identity(void)
{
q[0]=1.0;
q[1]=q[2]=q[3]=0.0;
translate.v[0]=translate.v[1]=translate.v[2]=0.0;
}
///////
static void quat_inv(double const *a,double *);
static void quat_mult(double const *a,double const *b,double *ans);
static double angle_of(double *a);
static void quat_fix(double *q);
static void quat2rot(double const *,m33 &);
static void rot2quat(m33 const &,double *);
static double quat_mag(double *p)
{
return sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]+p[3]*p[3]);
}
};
#endif //RIGIDBODYTRANS_H