C3767 error

J

JW

I received this error while compiling OSE 6.0 with MSVC7.1
(it compiles with MSVC7.0).

otcbitset.cc
.../include\OTC\collctn\strgactn.hh(45) : error
C3767: 'otclib_hash' matching function is not accessible
could be the friend function
at '../include\OTC\misc\hash.hh(54)' : 'otclib_hash' [may
be found via argument-dependent lookup]
or the friend function
at '../include\OTC\misc\hash.hh
(64)' : 'otclib_hash' [may be found via argument-
dependent lookup]
.../include\OTC\collctn\strgactn.hh(55) : error
C3767: 'otclib_hash' matching function is not accessible
could be the friend function
at '../include\OTC\misc\hash.hh(54)' : 'otclib_hash' [may
be found via argument-dependent lookup]
or the friend function
at '../include\OTC\misc\hash.hh
(64)' : 'otclib_hash' [may be found via argument-
dependent lookup]


The info in the MSDN help wasn't clear to me.

Here are the two files causing the problem.

strgactn.hh

template<>
class OSE_EXPORT OTC_HashActions<char*>
{
public:
static int hash(char* const& s)
{ return otclib_hash(s); }
};

template<>
class OSE_EXPORT OTC_HashActions<const char*>
{
public:
static int hash(const char* const& s)
{ return otclib_hash(s); }
};


hash.hh

class OSE_EXPORT OTC_Hash
{
public:

static int hash(char const* theString);

friend inline int otclib_hash(char const* theString)
{ return OTC_Hash::hash
(theString); }

static int hash(char const* theString, u_int
theLength);

friend inline int otclib_hash(char const* theString,
u_int theLength)
{ return OTC_Hash::hash
(theString,theLength); }



Anyone know how to fix it?

Thanks.
 
J

JW

I got it.

Had to declare the friend function header inside the class
and implement it outside the class. I'm not sure if
that's the correct way to do it, but it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top