C:\Users\PC\Desktop\random\main.o:main.cpp:(.text+0x76)||undefined reference to `Tclass::FFunction()'|
I made my own class which is external from the main program and this is the error i get. Here is the code of my program.
The main program(.cpp)
#include<iostream>
#include "Tclass.h"
#include "Tclass.cpp"
using namespace std;
int main(){
Tclass object;
object.FFunction();
return 0;
}
The header file. (.h)
#ifndef TCLASS_H
#define TCLASS_H
class Tclass
{
public:
Tclass();
void FFunction();
};
#endif // TCLASS_H
The c++ style sheet(i think that's what it is called) (.cpp)
#include "Tclass.h"
#include<iostream>
using namespace std;
Tclass::Tclass()
{
cout << "An object for this class has been created \n";
}
void FFunction(){
cout << "The function has been created \n";
}
I am using code::block as my IDE. I also created the class with any destructors