I keep getting this error when I try compiling my code and I cannot seem to understand why.
Undefined symbols for architecture x86_64:
"Location::Location()", referenced from:
_main in main-64d6fd.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I use "g++ *main.cpp" to try and compile it, but I get the same error no matter what I do.
#include <iostream>
#include "location-proj.h"
using namespace std;
int main() {
Location loc;
return 0;
}
#include <iostream>
using namespace std;
class Location {
public:
Location();
private:
int row, col;
unsigned int nextDirection; //Uses ENUM as input
};
#include "location-proj.h"
Location::Location() {
this->row = 0;
this->col = 0;
this->nextDirection = 0;
}