0

I'm having this error in the following code:

#include <FWCacheEntry>

template<class T> class LoggerConfigCacheEntry : public FWCacheEntry<T>
{
public:
    LoggerConfigCacheEntry(FWCacheEntryData data) : FWCacheEntry<T>(data) //Error in this line
    {
        ResetCacheEntryScoreCounters();
    }

    ...
};

FWCacheEntry is:

template<class T> class FWCacheEntry
{
public:
    typedef T* FWCacheEntryData;

    FWCacheEntry(FWCacheEntryData data) 
    {
        _data = data;
    }

    ...
};

This code compiles cleanly in Solaris but not in Linux. I've read that this error is usually from referring to something unknown, but the include is there.

Can you help me.

Thanks

Synchro
  • 35,538
  • 15
  • 81
  • 104
  • There's this thing called template specialization, which makes it impossible to look up names that depend on unknown template arguments. `FWCacheEntryData` is such a name. – Ben Voigt Jul 10 '14 at 19:37

1 Answers1

0

I believe that you need:

  • fully qualify name;
  • add typename keyword to explicitly tell compiler that it's a type but not static variable;

Thus you need change:

LoggerConfigCacheEntry (FWCacheEntryData data)
        : FWCacheEntry <T> (data)

on:

LoggerConfigCacheEntry (typename FWCacheEntry <T>::FWCacheEntryData data)
        : FWCacheEntry <T> (data)

There are a lot of related questions:

Community
  • 1
  • 1
Gluttton
  • 5,739
  • 3
  • 31
  • 58
  • Thanks for the response, it worked! The error was very similar to the other question in fact, i need to study this template issues better. Thanks again. – user3806117 Jul 11 '14 at 09:23