hello all,
first of all I'd like to say i really like the site, it has helped me a lot these last weeks. i'm a big fan :-)
but here's the problem I've got:
i've made an AVL tree using template for the type of the Key and the Value (in the nodes).
then I initialized it, like this:
AVLTree<std::st ring, int> avl_common;
so just an AVL tree with key type => string and
value type=> int
then I had to pass it as reference to a function that reads the input from cin and puts every inerted word into the AVL tree, with as value: the number of times that word has occured in the input text.
this is were it blocks.
inlees(test, avl_common);
inlees= read in function and test is a text document and avl_common is the AVL where we're gonna insert them into.
the function 'inlees' looks like this:
template <typename Key, typename Value>
int inlees (ifstream& path, AVLTree<Key, Value>& l);
_
but when compiling, it says: (using g++)
/tmp/ccW1N4R5.o: In function `main':
main.cc:(.text+ 0xdb): undefined reference to `int inlees<std::bas ic_string<char, std::char_trait s<char>, std::allocator< char> >, int>(std::basic _ifstream<char, std::char_trait s<char> >&, AVLTree<std::ba sic_string<char , std::char_trait s<char>, std::allocator< char> >, int>&)'
so it doesnt seem it can do the matching between Key and string AND Value and int.
can anyone tell me here my problem is?
thx you very much!!
first of all I'd like to say i really like the site, it has helped me a lot these last weeks. i'm a big fan :-)
but here's the problem I've got:
i've made an AVL tree using template for the type of the Key and the Value (in the nodes).
then I initialized it, like this:
AVLTree<std::st ring, int> avl_common;
so just an AVL tree with key type => string and
value type=> int
then I had to pass it as reference to a function that reads the input from cin and puts every inerted word into the AVL tree, with as value: the number of times that word has occured in the input text.
this is were it blocks.
inlees(test, avl_common);
inlees= read in function and test is a text document and avl_common is the AVL where we're gonna insert them into.
the function 'inlees' looks like this:
template <typename Key, typename Value>
int inlees (ifstream& path, AVLTree<Key, Value>& l);
_
but when compiling, it says: (using g++)
/tmp/ccW1N4R5.o: In function `main':
main.cc:(.text+ 0xdb): undefined reference to `int inlees<std::bas ic_string<char, std::char_trait s<char>, std::allocator< char> >, int>(std::basic _ifstream<char, std::char_trait s<char> >&, AVLTree<std::ba sic_string<char , std::char_trait s<char>, std::allocator< char> >, int>&)'
so it doesnt seem it can do the matching between Key and string AND Value and int.
can anyone tell me here my problem is?
thx you very much!!
Comment