I'm currently working on an assignement concerning mobile robots. I'm developing on Windows with QT-Creator, using CMake and Visual C++ Compiler 10.0.
As the robot's working on Ubuntu, I need to compile the projekt using QT-Creator on Ubuntu with the GNU x86 compiler.
Now here's the problem, concerning the class Box, which is just storing some int-values:
Box.h
public:
Box();                                                                  
Box(int name, int sX, int sY, int width, int heigth);               
Box& operator = (Box &src);                                             
bool operator == (Box &src);                                     
private:
int name;                                                              
int startX, startY, endX, endY;                                       
int cgx, cgy;                                                        
int width, height;
There are also some get-methods in this header (like int getName() ).
The overloaded assignment-operator looks as following:
Box &Box::operator =(Box &src){
    this->cgx = src.getCenterX();
    this->cgy = src.getCenterY();
    this->endX = src.getEndX();
    this->endY = src.getEndY();
    this->startX = src.getStartX();
    this->startY = src.getStartY();
   return *this;} 
I'm using Box objects in another class, stored in a std::list<Box>.
On Windows, everything works fine. But on Ubuntu I get the error-message no match for 'operator=' (operand types are 'Box' and 'const Box') , which occurs in a function of std::list.
I'm quite new to C++ and haven't used const explicit anywhere. So how does this error happen and how do I solve it?
 
     
     
    