Hi,
I'm using Codeblocks as a compiler. So when i'm creating a new class by following File>New>Class it creates two files xxxx.h xxxx.cpp
Ok, code is simple.
#include <iostream>
#include "Sally.h"
using namespace std;
int main(){
Sally so;
}
Sally.h
#ifndef SALLY_H
#define SALLY_H
class Sally
{
public:
Sally();
protected:
private:
};
#endif // SALLY_H
Sally.cpp
#include "Sally.h"
#include <iostream>
using namespace std;
Sally::Sally()
{
cout << "i'm a constructor" << endl;
}
When i'm trying to run this it give an error
C:\Users\Artjom\Desktop\My Project\main.o:main.cpp|| undefined reference to `Sally::Sally()'|
||=== Build finished: 1 errors, 0 warnings ===|
Please can you tell me what is wrong?
Thanx