I'm attempting to create a function called Greetings, where I put it in a separate file. I followed a tutorial on youtube, but it kept giving me errors. Below is the source code for the main.cc, Greetings.cc, and Greetings.h. Though when I tried compiling it through my Mac's terminal it ran quite fine, but when I tried running it inside my text editor (Sublime Text 3), it keeps on giving me these weird errors, long ones. Does anyone see anything wrong?
main.cc
Code:
#include <cstdio>
#include "Greetings.h"
using namespace std;
int main() {
Greetings bo;
return 0;
}
Greetings.cc
Code:
#include <cstdio>
#include "Greetings.h"
Greetings::Greetings() {
printf("Hello, how are you?\n");
}
Greetings.h
Code:
#ifndef GREETINGS_H
#define GREETINGS_H
class Greetings {
public:
Greetings();
};
#endif