Hello,
I am try to compile this code using gcc in ubuntu. I get the error 'btree.cc:(.text+0x55a): undefined reference to `std::cout' '. I thought if i added using namespace std; it would start working but i am still getting the same error. Any suggestion on how i can fix it.

// Project: B*-trees floorplanning
// Advisor: Yao-Wen Chang  <ywchang@cis.nctu.edu.tw>
// Authors: Jer-Ming Hsu   <barz@cis.nctu.edu.tw>
// 	    Hsun-Cheng Lee <gis88526@cis.nctu.edu.tw>
// Sponsor: Arcadia Inc.
// Date:    7/19/2000 ~

//----------------------------------a-----------------------------------------
#include <stack>
#include <algorithm>
#include "btree.h"
#include <iostream>
#include "fplan.h"
#include <limits.h>

using namespace std;
//---------------------------------------------------------------------------
float rotate_rate = 0.3;
float swap_rate = 0.5;

//---------------------------------------------------------------------------
//   Initialization
//---------------------------------------------------------------------------

void B_Tree::clear(){
  // initial contour value
  contour_root = NIL;
  FPlan::clear();			// Commenting this out since it is calling the same function in btree.h
  //B_Tree.FPlan::clear();    // Calling inherited function clear() from fplan.h
	
}

void B_Tree::init(){
  // initialize contour structure
  contour.resize(modules_N);
    
  // initialize b*tree by complete binary tree
  nodes.resize(modules_N);
  nodes_root=0;
  for(int i=0; i < modules_N; i++){
    nodes[i].id = i;
    nodes[i].parent = (i+1)/2-1;
    nodes[i].left   = (2*i+1 < modules_N ? 2*i+1 : NIL);
    nodes[i].right  = (2*i+2 < modules_N ? 2*i+2 : NIL);
  }
  nodes[0].parent = NIL;
  best_sol.clear();
  last_sol.clear();
  clear();
  normalize_cost(10);
} 

//---------------------------------------------------------------------------
//   Testing, Debuging tools
//---------------------------------------------------------------------------

bool B_Tree::legal(){
  int num=0;
  return legal_tree(NIL,nodes_root,num);
}

bool B_Tree::legal_tree(int p,int n,int &num){
  num++;
  if(nodes[n].parent!=p) return false;
  if(nodes[n].left != NIL)
    if(legal_tree(n,nodes[n].left,num) != true) return false;

  if(nodes[n].right != NIL)
    if(legal_tree(n,nodes[n].right,num) != true) return false;

  if(p==NIL) // root
    return (num==modules_N);
  return true;
}

void B_Tree::testing(){
  int p,n;
  Solution E;

  do{
    n = rand()%modules_N;
    p = rand()%modules_N;

    while(n==nodes_root)		// n is not root
      n = rand()%modules_N;

    while(n==p||nodes[n].parent==p||nodes[p].parent==n)	// n != p & n.parent != p
      p = rand()%modules_N;
   
    Node &node = nodes[n];
    Node &parent = nodes[p];
    get_solution(E);
    swap_node(parent,node);
  }while(legal());

  cout << "p=" << p << ", n=" << n << endl;
  recover(E);
  show_tree();
  cout << "\n  p=" << p << ", n=" << n << endl;
  swap_node(nodes[p],nodes[n]);
  show_tree();
}

void B_Tree::show_tree(){
  cout << "root: " << nodes_root << endl;
  for(int i=0; i < modules_N; i++){
    cout << nodes[i].id << ": ";
    cout << nodes[i].left << " ";
    cout << nodes[i].parent << " ";
    cout << nodes[i].right << endl;
  }
}

//---------------------------------------------------------------------------
//   Placement modules
//---------------------------------------------------------------------------

void B_Tree::packing(){
  stack<int> S;

  clear();
  int p = nodes_root;

  place_module(p,NIL);
  Node &n = nodes[p];
  if(n.right != NIL)      S.push(n.right);
  if(n.left  != NIL)      S.push(n.left);

  // inorder traverse
  while(!S.empty()){
    p = S.top();
    S.pop();
    Node &n = nodes[p];

    assert(n.parent != NIL);
    bool is_left = (nodes[n.parent].left == n.id);
    place_module(p,n.parent,is_left);

    if(n.right != NIL)      S.push(n.right);
    if(n.left  != NIL)      S.push(n.left);
  }

  // compute Width, Height
  double max_x=-1,max_y=-1;
  for(int p= contour_root; p != NIL; p=contour[p].front){
    max_x = max(max_x,double(modules_info[p].rx));  
    max_y = max(max_y,double(modules_info[p].ry));
  }

  Width  = max_x;
  Height = max_y;
  Area   = Height*Width;

  FPlan::packing(); 	// for wirelength  
}

// is_left: default is true
void B_Tree::place_module(int mod,int abut,bool is_left){
  Module_Info &mod_mf = modules_info[mod];
  mod_mf.rotate       = nodes[mod].rotate;
  mod_mf.flip         = nodes[mod].flip;

  int w =  modules[mod].width;
  int h =  modules[mod].height;
  if(nodes[mod].rotate)
    swap(w,h);
  
  if(abut==NIL){	// root node
    contour_root = mod;
    contour[mod].back = NIL;
    contour[mod].front = NIL;
    mod_mf.x  = mod_mf.y = 0;
    mod_mf.rx = w, mod_mf.ry = h;
    return;
  }
  
  int p;   // trace contour from p

  if(is_left){	// left
    int abut_width = (nodes[abut].rotate ? modules[abut].height : 
                                           modules[abut].width);
    mod_mf.x  = modules_info[abut].x + abut_width;
    mod_mf.rx = mod_mf.x + w;
    p = contour[abut].front;

    contour[abut].front = mod;
    contour[mod].back = abut;

    if(p==NIL){  // no obstacle in X axis
      mod_mf.y = 0;
      mod_mf.ry = h;
      contour[mod].front = NIL;
      return;
    }
  }else{	// upper
    mod_mf.x = modules_info[abut].x;
    mod_mf.rx = mod_mf.x + w;
    p = abut;
     
    int n=contour[abut].back;

    if(n==NIL){ // i.e, mod_mf.x==0
      contour_root = mod;
      contour[mod].back = NIL;
    }
    else{
      contour[n].front = mod;
      contour[mod].back = n;
    }
  }
  
  int min_y = INT_MIN;
  int bx,by;
  assert(p!=NIL);
    
  for(; p!=NIL ; p=contour[p].front)
  {
    bx = modules_info[p].rx;
    by = modules_info[p].ry;
    min_y = max(min_y, by);
      
    if(bx >= mod_mf.rx){ 	// update contour
      mod_mf.y = min_y;
      mod_mf.ry = mod_mf.y + h;
      if(bx > mod_mf.rx){
        contour[mod].front = p;
        contour[p].back = mod;
      }else{ 			// bx==mod_mf.rx
        int n= contour[p].front;
        contour[mod].front = n;
        if(n!=NIL)
          contour[n].back = mod;
      }
      break;     
    }
  }


  if(p==NIL){
    mod_mf.y  = (min_y==INT_MIN? 0 : min_y);
    mod_mf.ry = mod_mf.y + h;
    contour[mod].front = NIL;
  }
}

//---------------------------------------------------------------------------
//   Manipulate B*Tree auxilary procedure
//---------------------------------------------------------------------------

void B_Tree::wire_nodes(int parent,int child,DIR edge){
  assert(parent!=NIL);
  (edge==LEFT? nodes[parent].left: nodes[parent].right) = child;
  if(child!=NIL) nodes[child].parent = nodes[parent].id;
}

int B_Tree::child(int node,DIR d){
  assert(node!=NIL);
  return (d==LEFT? nodes[node].left:nodes[node].right);  
}


//---------------------------------------------------------------------------
//   Simulated Annealing Temporal Solution
//---------------------------------------------------------------------------

void B_Tree::get_solution(Solution &sol){
  sol.nodes_root = nodes_root;
  sol.nodes = nodes;
  sol.cost = getCost();
}

void B_Tree::keep_sol(){
  get_solution(last_sol);
}

void B_Tree::keep_best(){
  get_solution(best_sol);
}

void B_Tree::recover(){
  recover(last_sol);
  // recover_partial();
}

void B_Tree::recover_best(){
  recover(best_sol);
}

void B_Tree::recover(Solution &sol){
  nodes_root = sol.nodes_root;
  nodes = sol.nodes;
}

void B_Tree::recover_partial(){
  if(changed_root != NIL)
    nodes_root = changed_root;
  
  for(int i=0; i < changed_nodes.size(); i++){
    Node &n = changed_nodes[i];
    nodes[n.id] = n;
  }
}

void B_Tree::add_changed_nodes(int n){
  if(n==NIL) return;

  for(int i=0; i < changed_nodes.size(); i++)
    if(changed_nodes[i].id == n)
	return;
  changed_nodes.push_back(nodes[n]);
}

//---------------------------------------------------------------------------
//   Simulated Annealing Permutation Operations
//---------------------------------------------------------------------------

void B_Tree::perturb(){
  int p,n;
  n = rand()%modules_N;

//  changed_nodes.clear();
//  changed_root = NIL;


  if(rotate_rate > rand_01()){
//    changed_nodes.push_back(nodes[n]);
    nodes[n].rotate = !nodes[n].rotate;
    if(rand_bool()) nodes[n].flip = !nodes[n].flip;
  }
  else{ 	

    if(swap_rate >rand_01()){
      do{
        p = rand()%modules_N;
      }while(n==p||nodes[n].parent==p||nodes[p].parent==n);

//      changed_nodes.push_back(nodes[p]);
//      changed_nodes.push_back(nodes[n]);

      swap_node(nodes[p],nodes[n]);

    }else{
      do{
        p = rand()%modules_N;
      }while(n==p);

//      changed_nodes.push_back(nodes[p]);
//      changed_nodes.push_back(nodes[n]);

      delete_node(nodes[n]);
      insert_node(nodes[p],nodes[n]);
    }
  }
}

void B_Tree::swap_node(Node &n1, Node &n2){

  if(n1.left!=NIL){  
    //add_changed_nodes(n1.left);
    nodes[n1.left].parent  = n2.id;
  }
  if(n1.right!=NIL){
    //add_changed_nodes(n1.right);
    nodes[n1.right].parent = n2.id;  
  }
  if(n2.left!=NIL){
    //add_changed_nodes(n2.left);
    nodes[n2.left].parent  = n1.id;
  }
  if(n2.right!=NIL){
    //add_changed_nodes(n2.right);
    nodes[n2.right].parent = n1.id;  
  }

  if(n1.parent != NIL){
    //add_changed_nodes(n1.parent);
    if(nodes[n1.parent].left==n1.id)
       nodes[n1.parent].left  = n2.id;
    else
       nodes[n1.parent].right = n2.id; 
  }else{
    changed_root = n1.id;
    nodes_root = n2.id;
  }

  if(n2.parent != NIL){
    //add_changed_nodes(n2.parent);
    if(nodes[n2.parent].left==n2.id)
       nodes[n2.parent].left  = n1.id;
    else
       nodes[n2.parent].right = n1.id; 
  }else{
//    changed_root = n2.id;
    nodes_root = n1.id;
  }

  swap(n1.left,n2.left);
  swap(n1.right,n2.right);
  swap(n1.parent,n2.parent);
}

void B_Tree::insert_node(Node &parent, Node &node){
  node.parent = parent.id;
  bool edge = rand_bool();

  if(edge){
    //add_changed_nodes(parent.left);
    node.left  = parent.left;
    node.right = NIL;
    if(parent.left!=NIL)
      nodes[parent.left].parent = node.id;

    parent.left = node.id;

  }else{
    //add_changed_nodes(parent.right);
    node.left  = NIL;
    node.right = parent.right;
    if(parent.right!=NIL)
      nodes[parent.right].parent = node.id;
    
    parent.right = node.id;
  }
}

void B_Tree::delete_node(Node &node){
  int child    = NIL;	// pull which child
  int subchild = NIL;   // child's subtree
  int subparent= NIL; 

  if(!node.isleaf()){
    bool left= rand_bool();			// choose a child to pull up
    if(node.left ==NIL) left=false;
    if(node.right==NIL) left=true;

    //add_changed_nodes(node.left);
    //add_changed_nodes(node.right);

    if(left){
      child = node.left;			// child will never be NIL
      if(node.right!=NIL){
        subchild  = nodes[child].right;
        subparent = node.right;
        nodes[node.right].parent = child; 
        nodes[child].right = node.right;	// abut with node's another child
      }
    }
    else{
      child = node.right;
      if(node.left!=NIL){
        subchild  = nodes[child].left;
        subparent = node.left;
	nodes[node.left].parent = child;
        nodes[child].left = node.left;
      }
    }
    //add_changed_nodes(subchild);
    nodes[child].parent = node.parent;
  }

  if(node.parent == NIL){			// root
//    changed_root = nodes_root;
    nodes_root = child;
  }else{					// let parent connect to child
    //add_changed_nodes(node.parent);
    if(node.id == nodes[node.parent].left)
      nodes[node.parent].left  = child;
    else
      nodes[node.parent].right = child;
  }

  // place subtree
  if(subchild != NIL){
    Node &sc = nodes[subchild];
    assert(subparent != NIL);

    while(1){
      Node &p = nodes[subparent];

      if(p.left==NIL || p.right==NIL){
        //add_changed_nodes(p.id);

	sc.parent = p.id;
        if(p.left==NIL) p.left = sc.id;
        else p.right = sc.id;
        break;
      }else{
	subparent = (rand_bool() ? p.left : p.right);
      }
    }
  }
}


bool B_Tree::delete_node2(Node &node,DIR pull){
  DIR npull = !pull;
 
  int p = node.parent;
  int n= node.id;
  int c= child(n,pull);
  int cn=child(n,npull);

  assert(n!= nodes_root); // not root;

  DIR p2c = (nodes[p].left==n ? LEFT:RIGHT);

  if(c==NIL){
    wire_nodes(p,cn,p2c);
    return (cn!=NIL);   // folding
  }else{
    wire_nodes(p,c,p2c);
  }

  while(c!=NIL){
    int k=child(c,npull);
    wire_nodes(c,cn ,npull);
    cn= k;
    n= c;
    c= child(c,pull);
  }

  if(cn != NIL){
    wire_nodes(n,cn,pull);
    return true;
  }else 
    return false;
}

/*
   Insert node into parent's left or right subtree according by "edge".
   Push node into parent's subtree in  "push" direction.

   if "fold" is true, then fold the leaf.
   (for the boundary condition of "delete" operation)

   delete <==> insert are permutating operations that can be recoved.
*/

void B_Tree::insert_node2(Node &parent,Node &node,
                        DIR edge=LEFT,DIR push=LEFT,bool fold){
  DIR npush = !push;
  int p= parent.id;
  int n= node.id;
  int c= child(p,edge);

  wire_nodes(p,n,edge);
  wire_nodes(n,c,push);
    
  while(c!=NIL){
    wire_nodes(n,child(c,npush) ,npush);
    n= c;
    c= child(c,push);
  }
  wire_nodes(n,NIL,npush);

  if(fold){
    wire_nodes(nodes[n].parent,NIL,push);
    wire_nodes(nodes[n].parent,n,npush); 
  }
}

the real error screen looks like this

ar> >&)'
btree.cc:(.text+0x52e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
btree.cc:(.text+0x55a): undefined reference to `std::cout'
btree.cc:(.text+0x55f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x56e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x57e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x58d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x595): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x59d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccuLLHAe.o: In function `B_Tree::show_tree()':
btree.cc:(.text+0x639): undefined reference to `std::cout'
btree.cc:(.text+0x63e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x64a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x652): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x65a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
btree.cc:(.text+0x68b): undefined reference to `std::cout'
btree.cc:(.text+0x690): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x6a0): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x6c6): undefined reference to `std::cout'
btree.cc:(.text+0x6cb): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x6db): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x701): undefined reference to `std::cout'
btree.cc:(.text+0x706): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x716): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x73c): undefined reference to `std::cout'
btree.cc:(.text+0x741): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x749): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x751): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccuLLHAe.o: In function `B_Tree::packing()':
btree.cc:(.text+0xa6b): undefined reference to `FPlan::packing()'
/tmp/ccuLLHAe.o: In function `B_Tree::perturb()':
btree.cc:(.text+0x1347): undefined reference to `rand_01()'
btree.cc:(.text+0x13a0): undefined reference to `rand_bool()'
btree.cc:(.text+0x13ee): undefined reference to `rand_01()'
/tmp/ccuLLHAe.o: In function `B_Tree::insert_node(Node&, Node&)':
btree.cc:(.text+0x17a2): undefined reference to `rand_bool()'
/tmp/ccuLLHAe.o: In function `B_Tree::delete_node(Node&)':
btree.cc:(.text+0x1885): undefined reference to `rand_bool()'
btree.cc:(.text+0x1b15): undefined reference to `rand_bool()'
/tmp/ccuLLHAe.o: In function `__static_initialization_and_destruction_0(int, int)':
btree.cc:(.text+0x1eb2): undefined reference to `std::ios_base::Init::Init()'
btree.cc:(.text+0x1eb7): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccuLLHAe.o: In function `Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x53): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x71): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x7a): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x260): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x2c8): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x2d1): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)':
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x38d): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x409): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x412): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x3ec): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x477): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x480): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)':
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x11c): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x152): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x15b): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)':
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0x7f): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0x9e): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0xa7): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<Node>::deallocate(Node*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE10deallocateEPS1_j[__gnu_cxx::new_allocator<Node>::deallocate(Node*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccuLLHAe.o: In function `std::vector<Node, std::allocator<Node> >::_M_check_len(unsigned int, char const*) const':
btree.cc:(.text._ZNKSt6vectorI4NodeSaIS0_EE12_M_check_lenEjPKc[std::vector<Node, std::allocator<Node> >::_M_check_len(unsigned int, char const*) const]+0x36): undefined reference to `std::__throw_length_error(char const*)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<Contour>::deallocate(Contour*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE10deallocateEPS1_j[__gnu_cxx::new_allocator<Contour>::deallocate(Contour*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccuLLHAe.o: In function `std::vector<Contour, std::allocator<Contour> >::_M_check_len(unsigned int, char const*) const':
btree.cc:(.text._ZNKSt6vectorI7ContourSaIS0_EE12_M_check_lenEjPKc[std::vector<Contour, std::allocator<Contour> >::_M_check_len(unsigned int, char const*) const]+0x36): undefined reference to `std::__throw_length_error(char const*)'
/tmp/ccuLLHAe.o: In function `std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)':
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x37): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x55): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x5e): undefined reference to `__cxa_end_catch'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<int*>::deallocate(int**, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE10deallocateEPS1_j[__gnu_cxx::new_allocator<int*>::deallocate(int**, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE8allocateEjPKv[__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE8allocateEjPKv[__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)]+0x39): undefined reference to `operator new(unsigned int)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE8allocateEjPKv[__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE8allocateEjPKv[__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE8allocateEjPKv[__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE8allocateEjPKv[__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij[__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccuLLHAe.o: In function `__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEjPKv[__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEjPKv[__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccuLLHAe.o:(.rodata._ZTV6B_Tree[vtable for B_Tree]+0x24): undefined reference to `FPlan::getCost()'
/tmp/ccuLLHAe.o:(.rodata._ZTI6B_Tree[typeinfo for B_Tree]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/ccuLLHAe.o:(.rodata._ZTI6B_Tree[typeinfo for B_Tree]+0x8): undefined reference to `typeinfo for FPlan'
/tmp/ccuLLHAe.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
/tmp/ccuLLHAe.o:(.eh_frame+0x147): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
inder@ubuntu:~/Desktop/code$ clear

inder@ubuntu:~/Desktop/code$ cc btree.cc
/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/crt1.o: In function `_start':
/build/buildd/eglibc-2.10.1/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
/tmp/ccmzKzTH.o: In function `B_Tree::clear()':
btree.cc:(.text+0x1a): undefined reference to `FPlan::clear()'
/tmp/ccmzKzTH.o: In function `B_Tree::init()':
btree.cc:(.text+0x214): undefined reference to `FPlan::normalize_cost(int)'
/tmp/ccmzKzTH.o: In function `B_Tree::testing()':
btree.cc:(.text+0x4eb): undefined reference to `std::cout'
btree.cc:(.text+0x4f0): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x4ff): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x50f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x51e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x526): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x52e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
btree.cc:(.text+0x55a): undefined reference to `std::cout'
btree.cc:(.text+0x55f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x56e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x57e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x58d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x595): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x59d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccmzKzTH.o: In function `B_Tree::show_tree()':
btree.cc:(.text+0x639): undefined reference to `std::cout'
btree.cc:(.text+0x63e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x64a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x652): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x65a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
btree.cc:(.text+0x68b): undefined reference to `std::cout'
btree.cc:(.text+0x690): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x6a0): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x6c6): undefined reference to `std::cout'
btree.cc:(.text+0x6cb): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x6db): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x701): undefined reference to `std::cout'
btree.cc:(.text+0x706): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x716): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
btree.cc:(.text+0x73c): undefined reference to `std::cout'
btree.cc:(.text+0x741): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
btree.cc:(.text+0x749): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
btree.cc:(.text+0x751): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
/tmp/ccmzKzTH.o: In function `B_Tree::packing()':
btree.cc:(.text+0xa6b): undefined reference to `FPlan::packing()'
/tmp/ccmzKzTH.o: In function `B_Tree::perturb()':
btree.cc:(.text+0x1347): undefined reference to `rand_01()'
btree.cc:(.text+0x13a0): undefined reference to `rand_bool()'
btree.cc:(.text+0x13ee): undefined reference to `rand_01()'
/tmp/ccmzKzTH.o: In function `B_Tree::insert_node(Node&, Node&)':
btree.cc:(.text+0x17a2): undefined reference to `rand_bool()'
/tmp/ccmzKzTH.o: In function `B_Tree::delete_node(Node&)':
btree.cc:(.text+0x1885): undefined reference to `rand_bool()'
btree.cc:(.text+0x1b15): undefined reference to `rand_bool()'
/tmp/ccmzKzTH.o: In function `__static_initialization_and_destruction_0(int, int)':
btree.cc:(.text+0x1eb2): undefined reference to `std::ios_base::Init::Init()'
btree.cc:(.text+0x1eb7): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccmzKzTH.o: In function `Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x53): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x71): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE20_M_allocate_and_copyIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEPS0_jT_SA_[Node* std::vector<Node, std::allocator<Node> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > > >(unsigned int, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >, __gnu_cxx::__normal_iterator<Node const*, std::vector<Node, std::allocator<Node> > >)]+0x7a): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x260): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x2c8): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<Node, std::allocator<Node> >::_M_insert_aux(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, Node const&)]+0x2d1): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)':
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x38d): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x409): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI7ContourSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Contour, std::allocator<Contour> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Contour*, std::vector<Contour, std::allocator<Contour> > >, unsigned int, Contour const&)]+0x412): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)':
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x3ec): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x477): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt6vectorI4NodeSaIS0_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS0_S2_EEjRKS0_[std::vector<Node, std::allocator<Node> >::_M_fill_insert(__gnu_cxx::__normal_iterator<Node*, std::vector<Node, std::allocator<Node> > >, unsigned int, Node const&)]+0x480): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)':
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x11c): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x152): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEj[std::_Deque_base<int, std::allocator<int> >::_M_initialize_map(unsigned int)]+0x15b): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)':
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0x7f): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0x9e): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxERKi[std::deque<int, std::allocator<int> >::_M_push_back_aux(int const&)]+0xa7): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<Node>::deallocate(Node*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE10deallocateEPS1_j[__gnu_cxx::new_allocator<Node>::deallocate(Node*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccmzKzTH.o: In function `std::vector<Node, std::allocator<Node> >::_M_check_len(unsigned int, char const*) const':
btree.cc:(.text._ZNKSt6vectorI4NodeSaIS0_EE12_M_check_lenEjPKc[std::vector<Node, std::allocator<Node> >::_M_check_len(unsigned int, char const*) const]+0x36): undefined reference to `std::__throw_length_error(char const*)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<Contour>::deallocate(Contour*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE10deallocateEPS1_j[__gnu_cxx::new_allocator<Contour>::deallocate(Contour*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccmzKzTH.o: In function `std::vector<Contour, std::allocator<Contour> >::_M_check_len(unsigned int, char const*) const':
btree.cc:(.text._ZNKSt6vectorI7ContourSaIS0_EE12_M_check_lenEjPKc[std::vector<Contour, std::allocator<Contour> >::_M_check_len(unsigned int, char const*) const]+0x36): undefined reference to `std::__throw_length_error(char const*)'
/tmp/ccmzKzTH.o: In function `std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)':
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x37): undefined reference to `__cxa_begin_catch'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x55): undefined reference to `__cxa_rethrow'
btree.cc:(.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_[std::_Deque_base<int, std::allocator<int> >::_M_create_nodes(int**, int**)]+0x5e): undefined reference to `__cxa_end_catch'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<int*>::deallocate(int**, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE10deallocateEPS1_j[__gnu_cxx::new_allocator<int*>::deallocate(int**, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE8allocateEjPKv[__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI4NodeE8allocateEjPKv[__gnu_cxx::new_allocator<Node>::allocate(unsigned int, void const*)]+0x39): undefined reference to `operator new(unsigned int)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE8allocateEjPKv[__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorI7ContourE8allocateEjPKv[__gnu_cxx::new_allocator<Contour>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE8allocateEjPKv[__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIPiE8allocateEjPKv[__gnu_cxx::new_allocator<int*>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned int)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij[__gnu_cxx::new_allocator<int>::deallocate(int*, unsigned int)]+0xd): undefined reference to `operator delete(void*)'
/tmp/ccmzKzTH.o: In function `__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)':
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEjPKv[__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)]+0x24): undefined reference to `std::__throw_bad_alloc()'
btree.cc:(.text._ZN9__gnu_cxx13new_allocatorIiE8allocateEjPKv[__gnu_cxx::new_allocator<int>::allocate(unsigned int, void const*)]+0x32): undefined reference to `operator new(unsigned int)'
/tmp/ccmzKzTH.o:(.rodata._ZTV6B_Tree[vtable for B_Tree]+0x24): undefined reference to `FPlan::getCost()'
/tmp/ccmzKzTH.o:(.rodata._ZTI6B_Tree[typeinfo for B_Tree]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/ccmzKzTH.o:(.rodata._ZTI6B_Tree[typeinfo for B_Tree]+0x8): undefined reference to `typeinfo for FPlan'
/tmp/ccmzKzTH.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
/tmp/ccmzKzTH.o:(.eh_frame+0x147): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

post btree.h so that we can compile it.

Is all of your code contained in one file or spread out over multiple files?

Based on you mentioning "modules" in your code, and the includes you've listed. I suspect that it is spread out. Assuming that's correct, it's likely that you're not including <iostream> in one of your implementation files that requires it.

Without the proper headers, the compiler can't know what objects are even if you correctly specify the namespace to use.

Is all of your code contained in one file or spread out over multiple files?

Based on you mentioning "modules" in your code, and the includes you've listed. I suspect that it is spread out. Assuming that's correct, it's likely that you're not including <iostream> in one of your implementation files that requires it.

Without the proper headers, the compiler can't know what objects are even if you correctly specify the namespace to use.

The files are spread out. I have included a link which contains all the files. I have included iostream but i still get that error.

I have included iostream but i still get that error.

No you didn't. Look again at btree.cc

The file that you posted above (that is, your post #1), actually contains both
#include <iostream>
using namespace std;

So given that you are really getting those errors that you posted, now, are you absolutely sure that you are compiling the correct file(s)? I have a hunch that you are compiling the original 10 year old files.

I have a hunch that you are compiling the original 10 year old files.

I think you may be right. Here is the first few lines of the file what is in the tar file that he posted. Note that it's a lot different than the file he posted in the original post.

// Project: B*-trees floorplanning
// <snipped out personal information>
// Date:    7/19/2000 ~

//---------------------------------------------------------------------------
#include <stack>
#include <algorithm>
#include "btree.h"
//---------------------------------------------------------------------------
float rotate_rate = 0.3;
float swap_rate = 0.5;

thanks for your help, it was really appreciated. I have figured out where the problem was. There were mainly in the header files such as stdlib and limits.h, a few other changes and it started to work. Curious though because it was working on fedora and now i am using ubuntu it did not work.

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.