Why does the linker not work correctly when definitions are implemented in cpp file
I do not understand how to compile c++ code correctly. I have a test file using an example class and I continue to get the error:
user@MacBook-Pro Online-Order-OOP-Project % clang++ -std=c++11 -o test.out test.cpp
Undefined symbols for architecture arm64:
“Point::getX()”, referenced from:
_main in test-3f2ef3.o
“Point::Point()”, referenced from:
_main in test-3f2ef3.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It was my understanding that using the #include statements would handle the linking for me. How do I make this compile correctly?