Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.81 KB | None | 0 0
  1. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:4:1: error: redefinition of ‘BST::BST()’
  2. 4 | BST::BST(){
  3. | ^~~
  4. In file included from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  5. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:26:3: note: ‘BST::BST()’ previously defined here
  6. 26 | BST(){
  7. | ^~~
  8. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘std::shared_ptr<bst_node> BST::InitNode(int)’:
  9. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:13:3: error: ‘var’ was not declared in this scope
  10. 13 | var node = new bst_node(data, NULL, NULL);
  11. | ^~~
  12. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:15:31: error: ‘node’ was not declared in this scope
  13. 15 | return shared_ptr<bst_node>(node);
  14. | ^~~~
  15. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::Insert(std::shared_ptr<bst_node>)’:
  16. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:22:31: warning: NULL used in arithmetic [-Wpointer-arith]
  17. 22 | while (currentNode->data != NULL){
  18. | ^~~~
  19. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::Remove(int)’:
  20. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:54:31: warning: NULL used in arithmetic [-Wpointer-arith]
  21. 54 | while (currentNode->data != NULL){
  22. | ^~~~
  23. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:65:29: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
  24. 65 | currentNode->data = NULL;
  25. | ^~~~
  26. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:68:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
  27. 68 | bst_node tempNode = copy(currentNode);
  28. | ^
  29. In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
  30. from /usr/include/c++/9.1.0/string:40,
  31. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
  32. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  33. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
  34. 465 | copy(_II __first, _II __last, _OI __result)
  35. | ^~~~
  36. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
  37. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:68:45: note: candidate expects 3 arguments, 1 provided
  38. 68 | bst_node tempNode = copy(currentNode);
  39. | ^
  40. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:70:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
  41. 70 | delete tempNode;
  42. | ^~~~~~~~
  43. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:73:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
  44. 73 | bst_node tempNode = copy(currentNode);
  45. | ^
  46. In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
  47. from /usr/include/c++/9.1.0/string:40,
  48. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
  49. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  50. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
  51. 465 | copy(_II __first, _II __last, _OI __result)
  52. | ^~~~
  53. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
  54. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:73:45: note: candidate expects 3 arguments, 1 provided
  55. 73 | bst_node tempNode = copy(currentNode);
  56. | ^
  57. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:75:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
  58. 75 | delete tempNode;
  59. | ^~~~~~~~
  60. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:78:45: error: no matching function for call to ‘copy(std::shared_ptr<bst_node>&)’
  61. 78 | bst_node tempNode = copy(currentNode);
  62. | ^
  63. In file included from /usr/include/c++/9.1.0/bits/char_traits.h:39,
  64. from /usr/include/c++/9.1.0/string:40,
  65. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:4,
  66. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  67. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: candidate: ‘template<class _II, class _OI> _OI std::copy(_II, _II, _OI)’
  68. 465 | copy(_II __first, _II __last, _OI __result)
  69. | ^~~~
  70. /usr/include/c++/9.1.0/bits/stl_algobase.h:465:5: note: template argument deduction/substitution failed:
  71. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:78:45: note: candidate expects 3 arguments, 1 provided
  72. 78 | bst_node tempNode = copy(currentNode);
  73. | ^
  74. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:79:24: error: base operand of ‘->’ has non-pointer type ‘bst_node’
  75. 79 | while (tempNode->left != NULL){
  76. | ^~
  77. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:80:30: error: base operand of ‘->’ has non-pointer type ‘bst_node’
  78. 80 | tempNode = tempNode->left;
  79. | ^~
  80. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:82:37: error: base operand of ‘->’ has non-pointer type ‘bst_node’
  81. 82 | currentNode->data = tempNode->data;
  82. | ^~
  83. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:83:16: error: type ‘struct bst_node’ argument given to ‘delete’, expected pointer
  84. 83 | delete tempNode;
  85. | ^~~~~~~~
  86. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘int BST::Size(std::shared_ptr<bst_node>)’:
  87. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:113:20: warning: NULL used in arithmetic [-Wpointer-arith]
  88. 113 | if(subt->data == NULL){
  89. | ^~~~
  90. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp: In member function ‘void BST::ToVector(std::shared_ptr<bst_node>, std::vector<int>&)’:
  91. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:127:14: error: void value not ignored as it ought to be
  92. 127 | *vec.resize(BST::Size(subt));
  93. | ~~~~~~~~~~^~~~~~~~~~~~~~~~~
  94. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:129:20: warning: NULL used in arithmetic [-Wpointer-arith]
  95. 129 | if(subt->data == NULL){
  96. | ^~~~
  97. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:133:38: error: no matching function for call to ‘std::vector<int>::insert(int&, int&)’
  98. 133 | *vec.insert(*vec.begin(),subt->data);
  99. | ^
  100. In file included from /usr/include/c++/9.1.0/vector:72,
  101. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:6,
  102. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  103. /usr/include/c++/9.1.0/bits/vector.tcc:130:5: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::value_type = int]’
  104. 130 | vector<_Tp, _Alloc>::
  105. | ^~~~~~~~~~~~~~~~~~~
  106. /usr/include/c++/9.1.0/bits/vector.tcc:132:27: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
  107. 132 | insert(const_iterator __position, const value_type& __x)
  108. | ~~~~~~~~~~~~~~~^~~~~~~~~~
  109. In file included from /usr/include/c++/9.1.0/vector:67,
  110. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.h:6,
  111. from /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:1:
  112. /usr/include/c++/9.1.0/bits/stl_vector.h:1290:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::value_type = int]’
  113. 1290 | insert(const_iterator __position, value_type&& __x)
  114. | ^~~~~~
  115. /usr/include/c++/9.1.0/bits/stl_vector.h:1290:29: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
  116. 1290 | insert(const_iterator __position, value_type&& __x)
  117. | ~~~~~~~~~~~~~~~^~~~~~~~~~
  118. /usr/include/c++/9.1.0/bits/stl_vector.h:1307:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*]’
  119. 1307 | insert(const_iterator __position, initializer_list<value_type> __l)
  120. | ^~~~~~
  121. /usr/include/c++/9.1.0/bits/stl_vector.h:1307:29: note: no known conversion for argument 1 from ‘int’ to ‘std::vector<int>::const_iterator’ {aka ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’}
  122. 1307 | insert(const_iterator __position, initializer_list<value_type> __l)
  123. | ~~~~~~~~~~~~~~~^~~~~~~~~~
  124. /usr/include/c++/9.1.0/bits/stl_vector.h:1332:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = int*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; typename __gnu_cxx::__alloc_traits<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_pointer = const int*; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = int]’
  125. 1332 | insert(const_iterator __position, size_type __n, const value_type& __x)
  126. | ^~~~~~
  127. /usr/include/c++/9.1.0/bits/stl_vector.h:1332:7: note: candidate expects 3 arguments, 2 provided
  128. /usr/include/c++/9.1.0/bits/stl_vector.h:1376:2: note: candidate: ‘template<class _InputIterator, class> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = int; _Alloc = std::allocator<int>]’
  129. 1376 | insert(const_iterator __position, _InputIterator __first,
  130. | ^~~~~~
  131. /usr/include/c++/9.1.0/bits/stl_vector.h:1376:2: note: template argument deduction/substitution failed:
  132. /home/ted/Downloads/fukn-kyle/bstAssignment/code/BST.cpp:133:38: note: candidate expects 3 arguments, 2 provided
  133. 133 | *vec.insert(*vec.begin(),subt->data);
  134. | ^
  135. make[2]: *** [CMakeFiles/run_app.dir/build.make:76: CMakeFiles/run_app.dir/code/BST.cpp.o] Error 1
  136. make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/run_app.dir/all] Error 2
  137. make: *** [Makefile:141: all] Error 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement