Solved

# How to convert function from visual studio C++ to QT c++ ?

Posted on 2011-03-20

Hi Experts,

I have this function:

Vector Vector::operator *(Matrix &m) // return MatrixMulVector(this, m)

{

return (m * (*this));

}

where Vector:

Vector() { Set(0, 0, 0); }

Vector(float _x, float _y, float _z) { Set(_x, _y, _z); }

Vector(Vector &v) { Set(v.x, v.y, v.z); }

and Matrix:

Matrix() { memset(p,0,sizeof(float)*9); } // nullify matrix

Matrix( float xx, float xy, float xz,

float yx, float yy, float yz,

float zx, float zy, float zz) { Set(xx, xy, xz, yx, yy, yz, zx, zy, zz); } // construct matrix from 9 floats

Matrix(float ax, float ay, float az) { SetAng(ax, ay, az); } // construct matrix form 3 angles

Matrix(Matrix &m) { memcpy(p, m.p, sizeof(float)*9); }

My problem is that I can't compile it in QT 4.7 for Linux. However, it works without any problem in Visual Studio.

In QT I get this error:

no matching function for call to 'Vector::Vector(Vector)'

candidates are: Vector::Vector(Vector&)

Can someone tell me what should I change to create the equivalent of this function in QT ?

Thanks,

Peter