please i have a little problem creating a class and making it run. The class is created separately as a header file with it's source code.
whenever i build the source code of the class, i get an error that says: undefined reference to 'WinMain@16'. And whenever I run the main, it gives me the error: undefined reference to 'samclass::samclass'
here's my code
main
#include<iostream>
#include "samclass.h"
using namespace std;
int main(){
samclass obj;
return 0;}
header
#ifndef SAMCLASS_H
#define SAMCLASS_H
#include <iostream>
using namespace std;
class samclass
{
public:
samclass();
void printcrap();
};
#endif // SAMCLASS_H
header source code
#include "samclass.h"
#include <iostream>
using namespace std;
samclass::samclass()
{
}
void samclass::printcrap(){
cout<<"this is the real crap"<<endl;
}
I need help.