the error by the compiler is
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe Untitled1.o plants.o -o "Project1.exe" -L"C:/Dev-Cpp/lib"
Untitled1.o(.text+0x182):Untitled1.cpp: undefined reference to `Plants::Plants()'
collect2: ld returned 1 exit status
make.exe: *** [Project1.exe] Error 1
Execution terminated
main code is
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
using std::getline;
#include "Plants.h"
int main()
{
string kind;
Plants plant1;
cout<<"Enter plant kind"<<endl;
cin >> kind;
plant1.setStats(kind);
cout << plant1.getAge() << " " << plant1.getSize() << " " << plant1.getName() << endl;
}
header file
#include <string>
using std::string;
class Plants
{
public:
void setStats(string);
int getSize();
int getAge();
string getName();
private:
string kind;
string name;
int age;
int size;
};
and .cpp file
// Class automatically generated by Dev-C++ New Class wizard
#include <iostream>
#include <cstdlib>
using std::rand;
#include "Plants.h"
void Plants::setStats(string kind)
{
name = kind;
size = 1 + rand()%10;
age = 0;
}
int Plants::getSize()
{
return size;
}
int Plants::getAge()
{
return age;
}
string Plants::getName()
{
return name;
}