Original Post
I guess its a good thing that I am about to take a class in template metaprogramming, becuase I have just found out it has to be one of the weaker points in my programming part of my brain. I just can't seem to squash this linker bug. I'm getting an unresolved externals for a template method: The core.hpp file does include the library.hpp too. Here's the linker error: Anyone have any ideas? Thanks a head of time.I guess its a good thing that I am about to take a class in template metaprogramming, becuase I have just found out it has to be one of the weaker points in my programming part of my brain. I just can't seem to squash this linker bug. I'm getting an unresolved externals for a template method: The core.hpp file does include the library.hpp too. Here's the linker error: Anyone have any ideas? Thanks a head of time. [Edited by - bkt on August 1, 2005 10:11:35 PM]
template<class Tp> bool LibraryManager::load(Tp* p,string szFilepath)
{
// we need a path to work with anything right?
if(szFilepath.empty())
return false;
// load the library and return the pointer (through OS specific functions)
void* p = Platform::LoadLibrary( szFilepath );
if(!p)
return false
m_List.push_back( p );
p = static_cast<Tp*>( Platform::GetProcAddress(p, "ExportAPI") );
return true;
}
class LibraryManager : public ISingleton<LibraryManager>
{
public:
// constructor/destructor
LibraryManager(void);
~LibraryManager(void);
// methods
template<class Tp> bool load(Tp*,string);
private:
// members
CLibraryList m_List;
};
bool VideoTask::start(void)
{
// we're loading the video library up to make sure we have use of it
if(!LibraryManager::ptr()->load(m_pDevice,"opengl.dll"))
return false;
return true;
}
Linking...
tasks.obj : error LNK2019: unresolved external symbol "public: bool __thiscall LibraryManager::load<class IVideoDevice>(class IVideoDevice *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)"
template<class Tp> bool LibraryManager::load(Tp* p,string szFilepath)
{
// we need a path to work with anything right?
if(szFilepath.empty())
return false;
// load the library and return the pointer (through OS specific functions)
void* p = Platform::LoadLibrary( szFilepath );
if(!p)
return false
m_List.push_back( p );
p = static_cast<Tp*>( Platform::GetProcAddress(p, "ExportAPI") );
return true;
}
class LibraryManager : public ISingleton<LibraryManager>
{
public:
// constructor/destructor
LibraryManager(void);
~LibraryManager(void);
// methods
template<class Tp> bool load(Tp*,string);
private:
// members
CLibraryList m_List;
};
bool VideoTask::start(void)
{
// we're loading the video library up to make sure we have use of it
if(!LibraryManager::ptr()->load(m_pDevice,"opengl.dll"))
return false;
return true;
}
Linking...
tasks.obj : error LNK2019: unresolved external symbol "public: bool __thiscall LibraryManager::load<class IVideoDevice>(class IVideoDevice *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)"