Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualRobot Ninja

Posted 21 December 2012 - 09:29 PM

Thank you edd for helping me out so much. I feel like I should buy you a small gift for the holidays. lol

I think the design for my hash table is almost complete - I just have to clean up compiler errors here and there. I've been learning from some template programming mistakes as I go through my code. There is one error that I'm encountering right now that has be a little bewildered:

error C2678: binary '<' : no operator found which takes a left-hand operand of type 'const HashContainer<Key,Data>' (or there is no acceptable conversion)

It's pointing to one of the beginning lines of my list's Insert code:
if (m_pFront == nullptr || item < m_pFront->GetData())

However, I'm pretty sure I have the appropriate operator< overload inside my HashContainer class. Do you or anyone else have any idea what it could be?

*EDIT* I figured out what the problem was. My GetKey function was returning a const reference to the key, but I did not append the const keyword at the end of the function declaration. However, the last compiler error I have now is this hot mess:

error LNK2019: unresolved external symbol "public: __thiscall HashContainer<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int>::~HashContainer<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int>(void)" (??1?$HashContainer@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@@QAE@XZ) referenced in function "public: void __thiscall ChainedHashTable<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,struct Hash<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::Insert(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int const &)" (?Insert@?$ChainedHashTable@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HU?$Hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABH@Z)
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\Nova\Dropbox\ThachDev\~C++\Data_Structures\Debug\BORG_Language.exe : fatal error LNK1120: 2 unresolved externals

#1Robot Ninja

Posted 21 December 2012 - 08:18 PM

Thank you edd for helping me out so much. I feel like I should buy you a small gift for the holidays. lol

I think the design for my hash table is almost complete - I just have to clean up compiler errors here and there. I've been learning from some template programming mistakes as I go through my code. There is one error that I'm encountering right now that has be a little bewildered:

error C2678: binary '<' : no operator found which takes a left-hand operand of type 'const HashContainer<Key,Data>' (or there is no acceptable conversion)

It's pointing to one of the beginning lines of my list's Insert code:
if (m_pFront == nullptr || item < m_pFront->GetData())

However, I'm pretty sure I have the appropriate operator< overload inside my HashContainer class. Do you or anyone else have any idea what it could be?

PARTNERS