Classs in C++

I have created these classes and used code::block to compile them but there is a "undefined reference Rectangle::setWid()" "undefined reference Rectangle::setLen()"...
Please help.
Here is my codes:

#ifndef RECTANGLE_H
#define RECTANGLE_H


class Rectangle
{
private:
double len;
double wid;
public:
void setLen(double);
void setWid(double);
double getLen() const;
double getWid() const;
double getArea() const;
};

#endif // RECTANGLE_H

/*I saved these files in Rectangle folder.*/

#include "rectangle.h"
#include<cstdlib>
#include<cctype>
#include<iostream>

using namespace std;

void Rectangle::setLen(double l)
{
len = l;
}
void Rectangle::setWid(double w)
{
wid = w;
}
double Rectangle::getLen() const
{
return len;
}
double Rectangle::getWid() const
{
return wid;
}

/*I also saved these files in Rectangle folder.*/

#include<iostream>
#include "rectangle.h"
#include<cctype>
#include<cstdlib>

using namespace std;
int main()
{
Rectangle l;
int main()
{
Rectangle l;
l.setLen(3);
l.setWid(4);
cout << "The area is: " << l.getArea() << endl;

return 0;
} l.setLen(3);
l.setWid(4);
cout << "The area is: " << l.getArea() << endl;

return 0;
}

but when I compiled, the message
"undefined reference Rectangle::setWid()" "undefined reference Rectangle::setLen()"...
showed up.

Please help.
thank you very much!
closed account (Dy7SLyTq)
please dont double post
Topic archived. No new replies allowed.