undefined reference in void btree::insertion(int)

#include<iostream>
using namespace std;
struct node
{
int data;
node* l;
node* r;
};

class btree
{
private:
node* root;
void insertion(node*, int);
void clear();


public:
btree();
~btree();
void insert(int);
void view();
void print(node*);


};
int main()
{
btree t;
for(int i=0; i<11; i++)
{
t.insert(i);
}
t.view();
return 0;
}

btree::btree()
{
root=NULL;
}
btree::~btree()
{
clear();
}
void btree::insert(int i)
{
insertion(root,i);
}

void insertion(node* root, int i)
{
if(root==NULL)
{
root=new node;
root->data=i;
root->l=NULL;
root->r=NULL;
}
else if(i<root->data)
{
insertion(root->l,i);
}
else
{
insertion(root->r,i);
}
}

void btree::clear()
{

}
void btree::view()
{
print(root);
}
void btree::print(node* root)
{
node*curr=root;
if(curr!=0)
{
print(curr->l);
cout << curr->data;
print(curr->r);
}
}

what is the problem when i run this program i get a compile error showe me "undefined reference in void btree::insertion(int)"
If some one can help me

Thanks in advance
change void insertion(node* root, int i){...} to void btree::insertion(node* root, int i){...}
Topic archived. No new replies allowed.