||=== Build: Debug in korn (compiler: GNU GCC Compiler) ===|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\..\..\..\libmingw32.a(main.o):main.c:(.text.startup+0xa7)||undefined reference to `WinMain@16'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
i am getting that
when i make a normal simple class it works fine but when i add another class , then i get that error
got
main.cpp
-----------------
#include <iostream>
#include "hannah.h"
using namespace std;
int main()
{
Hannah ho(23);
ho.printCrap();
}
hannah.h
---------
#ifndef HANNAH_H
#define HANNAH_H
class Hannah
{
public:
Hannah(int);
void printCrap();
private:
int h;
};
#endif // HANNAH_H
hannah.cpp
----------
#include <iostream>
#include "hannah.h"
using namespace std;
Hannah::Hannah(int num)
:h(num)
{
}
void Hannah::printCrap(){
cout << "h=" << h << endl;
cout << "this->" << this->h << endl;
cout << "(*this).h=" << (*this).h << endl;
}
i try everything and that stupid error wont go away , so can someone plz explain what i did wrong or a way to fix it , i am using console application , with cnu gcc compiler
with code blocks 13.12 , hopes that all the info yall need to help me.