I am learning C ++ and I am looking at tutorials at thenewboston.org. I am trying to put classes in different files. When compiling in Codeblocks, I get the message "undefined link to WinMain @ 16". This is my code:
Burrito.cpp
#include "Burrito.h" #include <iostream> using namespace std; Burrito::Burrito() { cout << "Im a burrito!"<< endl; }
Burrito.h
#ifndef BURRITO_H #define BURRITO_H class Burrito { public: Burrito(); }; #endif
main.cpp
#include <iostream> #include "Burrito.h" using namespace std; int main() { Burrito Obj1; return 0; }
- All files are saved in the same directory.
- I am using windows 8 x64
- codeblocks lastversion
source share