0

ここに私が見ているエラーのリストがあります

RST.hpp:23:18: error: ‘RSTNode’ has not been declared
RST.hpp:23:38: error: ‘RSTNode’ has not been declared
RST.hpp:23:45: error: expected ‘,’ or ‘...’ before ‘<’ token
RST.hpp:41:30: error: ‘RSTNode’ has not been declared
RST.hpp:41:37: error: expected ‘,’ or ‘...’ before ‘<’ token
RST.hpp:44:28: error: ‘RSTNode’ has not been declared
RST.hpp:44:35: error: expected ‘,’ or ‘...’ before ‘<’ token
RST.hpp: In member function ‘virtual void RST<Data>::leftRotate(int)’:
RST.hpp:25:7: error: ‘RSTNode’ was not declared in this scope
RST.hpp:25:19: error: expected primary-expression before ‘&gt;’ token
RST.hpp:25:23: error: ‘dummyone’ was not declared in this scope
RST.hpp:25:34: error: ‘ptr’ was not declared in this scope
RST.hpp:26:19: error: expected primary-expression before ‘&gt;’ token
RST.hpp:26:23: error: ‘dummytwo’ was not declared in this scope
RST.hpp:27:19: error: expected primary-expression before ‘&gt;’ token
RST.hpp:27:23: error: ‘dummythree’ was not declared in this scope
RST.hpp: In member function ‘virtual bool RST<Data>::addToTree(int)’:
RST.hpp:46:11: error: ‘ptr’ was not declared in this scope
RST.hpp:48:13: error: ‘num’ was not declared in this scope
RST.hpp:50:11: error: ‘temp’ was not declared in this scope
RST.hpp:55:11: error: ‘temp’ was not declared in this scope
RST.hpp:63:20: error: expected type-specifier before ‘RSTNode’
RST.hpp:63:20: error: expected ‘;’ before ‘RSTNode’
RST.hpp:64:23: error: ‘temp’ was not declared in this scope
RST.hpp: In member function ‘bool RST<Data>::insert(const Data&) [with Data = countint]’:
test_RST.cpp:43:23:   instantiated from here
RST.hpp:14:7: error: no matching function for call to             RST<countint>::addToTree(BSTNode<countint>*&, NULL, const countint&)’
RST.hpp:14:7: note: candidate is:
RST.hpp:44:18: note: bool RST<Data>::addToTree(int) [with Data = countint]
RST.hpp:44:18: note:   candidate expects 1 argument, 3 provided

これは、この時点で問題のないテスターを除くすべてのコードです http://pastebin.com/3zu0hAy1

助けてください、なぜこれが起こっているのかわかりません!

注: BST は RST のスーパークラスです // BSTNode は RSTNode のスーパークラスです

ありがとうございました

4

1 に答える 1

2

「RST.hpp」に「RSTNode.hpp」が含まれていないことが問題のようです。したがって、「RSTNode が宣言されていません」というエラー メッセージは正確です。

エラーは、前の質問で推測したものではないため、その変更を元に戻した方がよいでしょう。

于 2012-10-26T07:01:35.227 に答える