implementing header file in .cpp file

This is my .cpp file:

1 #include "HCTree.hpp"
2
3 using namespace std;
4
5 void HCTree::build(){
6 cout<<"jdf"<<endl;
7 }

and this is my partial .hpp file:

29 class HCTree {
30 private:
31 HCNode* root;
32 vector<HCNode*> leaves;
33
34 public:
35 explicit HCTree() : root(0) {
36 leaves = vector<HCNode*>(256, (HCNode*) 0);
37 }
38
39 ~HCTree();
40
41 void build();

Why do I keep getting the following error?:

ndefined symbols for architecture x86_64:
"HCTree::build()", referenced from:
_main in main.o
"HCTree::~HCTree()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Last edited on
Topic archived. No new replies allowed.