I cannot get this to link at all :(
#ifndef SIMPLE_H_INCLUDED
#define SIMPLE_H_INCLUDED
class simple
{
public:
simple();
void setSimple(int);
int getSimple();
private:
int sim;
};
#endif // SIMPLE_H_INCLUDED
#include<iostream>
#include "simple.h"
simple::simple()
{
}
void simple::setSimple(int s)
{
sim =s;
}
int simple::getSimple()
{
return sim;
}
[Linker error] undefined reference to `WinMain@16'
#include <iostream>
#include "simple.h"
using namespace std;
int main()
{
simple s;
}
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
driver.cpp||undefined reference to `simple::simple|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
[Linker error] undefined reference to `simple::simple()'
Can someone please help? and tell me whats wrong?
Last edited on
Thank you so much for writing,
Were you able to get it to run as a console app?