So I am using Atom for a while but using it for the time for C++. I am getting a compilation error when I run the
Object Oriented Coding.cpp file
cpp file if I include my own header file for some reason. The cpp code is:
/* Object Oriented Coding.cpp file */
#include <iostream>
#include "Cat.h" // Our madeup header file
using namespace std;
int main(){
speak();
return 0;
}
The header file is:
/* Cat.h file with my prototypes */
#ifndef CAT_H_
#define CAT_H_
void speak();
#endif
The function file is:
#include <iostream>
using namespace std;
void speak(){
cout << "Meow Meow ..." << endl;
}
I am using the gcc-make-run package to compile my c++ code. Also all of the above files are in the same folder
The compilation error is:
C:\Users\JAPNIT~1\AppData\Local\Temp\ccIb2JOh.o:Object Oriented Coding.cpp:(.text+0xe): undefined reference to `speak()' collect2.exe: error: ld returned 1 exit status