I'm learning C++ with Code::Blocks, and everytime i try to create a new class, I get an error message saying:
undefined reference to `WinMain@16'
Here's the code I've been using:
Main Class
#include "Lime.h"
#include <iostream>
using namespace std;
int main()
{
Lime lime;
return 0;
}
Lime Class (.ccp):
#include "Lime.h"
#include <iostream>
using namespace std;
Lime::Lime()
{
cout<<"Hi!";
}
Lime Header (.h):
#ifndef LIME_H
#define LIME_H
class Lime
{
public:
Lime();
};
#endif
If someone knows, how to fix it, please, tell me!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…