BCDC++ Hash template issues error C2955

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

PhaTTy
Posts: 4
Joined: 2003-05-02 12:11

BCDC++ Hash template issues error C2955

Post by PhaTTy » 2003-05-02 12:17

Ok.. Got a good one for ya.. I am still trying to learn VC6 so please don't get mad at me if I am stupid :)

Here is the error I get when compiling:

C:\BCDC-src-bc\client\HashManager.cpp(137) : error C2955: 'hash' : use of class template requires template argument list
C:\DCPROJECT\STLPORT\stl/_hash_fun.h(40) : see declaration of 'hash'
C:\BCDC-src-bc\client\HashManager.cpp(432) : error C2955: 'hash' : use of class template requires template argument list
C:\DCPROJECT\STLPORT\stl/_hash_fun.h(40) : see declaration of 'hash'
C:\BCDC-src-bc\client\HashManager.cpp(439) : error C2955: 'hash' : use of class template requires template argument list
C:\DCPROJECT\STLPORT\stl/_hash_fun.h(40) : see declaration of 'hash'

Any ideas/suggestions would be much appreciated. I will paste below the lines of code from the errors above:

Inside the HashManager.cpp , I only pasted the line(s) which generated the error:

string HashManager::LookupHash(const TigerHash& hash) {

string HashManager::MakePrintableHash(const HashManager::TigerHash& hash) {

HashManager::TigerHash HashManager::MakeBinaryHash(const string &hash) {


And this is the line inside the _hash_fun.h file:

template <class _Key> struct hash { };


Thanks for the help and hope to hear back soon!

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-05-02 12:24

well,
it seems like vc6 chokes on the hash struct being used as a variable name. (which is not at all illogical)

so, if you change all occurences of the variable name 'hash' in those three functions to 'hashvar' (or anything that's not used already),
you should be fine
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

PhaTTy
Posts: 4
Joined: 2003-05-02 12:11

Post by PhaTTy » 2003-05-02 23:03

I will try it. thanks!

Who is online

Users browsing this forum: Google [Bot] and 0 guests