I am trying to build a binary tree in c++ when I compile I get an error that says:

Undefined                       first referenced
 symbol                             in file
Btree::destroy_tree(node*)          /var/tmp//cc1bssfK.o
Btree::remove(int, node*)           /var/tmp//cc1bssfK.o
Btree::insert(int, node*)           /var/tmp//cc1bssfK.o
Btree::search(int, node*)           /var/tmp//cc1bssfK.o
Btree::~Btree()                     /var/tmp//cc1bssfK.o
Btree::Btree()                      /var/tmp//cc1bssfK.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

Any suggestions would be great thanks!

Its a linking error, you must have forgot one source file in the compilation. The error means that the function definitions are not found by the linker. Those should normally be in the source file that correspond to the header in which these functions are declared, but you need to compile that source file along with your other source files in order for the linker to be able to find those function definitions.

If you have more trouble with solving this, just describe the split of functions between headers and sources, and how you are compiling them, and we can help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.