-
May 19th, 2009, 12:52 PM
#1
what do I am missing
I trying to link array.h,.cpp: Linkedlist.h,.cpp with a Hastable.h, .cpp, in the main program
useHashTables.cpp// what do I am missing
useHashTables.cpp.text+0x1cb): undefined reference to `HashTable<MyStruct>::HashTable(int (*)(MyStruct const&), int)'
useHashTables.cpp.text+0x1e6): undefined reference to `HashTable<MyStruct>::HashTable(int (*)(MyStruct const&), int)'
useHashTables.cpp.text+0x21d): undefined reference to `HashTable<MyStruct>::insert(MyStruct const&)'
useHashTables.cpp.text+0x249): undefined reference to `HashTable<MyStruct>::insert(MyStruct const&)'
useHashTables.cpp.text+0x279): undefined reference to `HashTable<MyStruct>::retrieve(MyStruct&)'
useHashTables.cpp.text+0x2e7): undefined reference to `HashTable<MyStruct>::retrieve(MyStruct&)'
-
May 19th, 2009, 12:56 PM
#2
Re: what do I am missing
When using templates, the implementation must be in the header itself.
One way to do this is, instead of compiling Hashtable.cpp directly, just put
#include "Hashtable.cpp"
at the end of Hashtable.h.
-
May 19th, 2009, 01:49 PM
#3
Re: what do I am missing
Thanks that work.
by the way....
One question, I have a Phonebook class that open a texfile with all data and display it
I want to call from this hash table.
can you give to me a idea for think clear what to take in considerations when develop the program?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|