I am getting below errors while compiling on V2013. I have benn struggling it for last 5 days. Any help much appreciated.
------------------------------------
error LNK2001: unresolved external symbol "double pnl::global_fakedummy" (?global_fakedummy@pnl@@3NA)
1>snpgm.obj : error LNK2001: unresolved external symbol "private: static class pnl::LogMultiplexor * pnl::LogMultiplexor::s_pStdMultiplexor" (?s_pStdMultiplexor@LogMultiplexor@pnl@@0PAV12@A)
------------------------------------------------------------------------------------------------
pnlFakeptr.hpp
#ifndef __PNLFAKEPTR_HPP__
#define __PNLFAKEPTR_HPP__
#include "pnlConfig.hpp"
PNL_BEGIN
#ifndef PNL_VC6
#define PNL_FAKEPTR( T ) (pnl::FakePtr< T >())
#else
#define PNL_FAKEPTR( T ) (pnl::FakePtr< T >((T *)0))
#endif
// remaining is internal stuff
// assuming double is properly aligned for any type. Otherwise cast will have undefined behaviour.
// Updated by Puru.Amradkar
extern PNL_API double global_fakedummy;
template< typename T >
#ifndef PNL_VC6
inline T *FakePtr()
#else
inline T *FakePtr( T * )
#endif
{
return (T *)&pnl::global_fakedummy;
}
PNL_END
#endif
------------------------------------------------------------------------------------
pnlfakrptr.cpp
#include "pnlFakePtr.hpp"
#include "pnlConfig.hpp"
PNL_BEGIN
// Updated by Puru.Amradkar
double pnl::global_fakedummy = 0;
PNL_END
------------------------------------------------------------
#ifndef __PNLLOGMULTIPLEXOR_HPP__
#define __PNLLOGMULTIPLEXOR_HPP__
#include "pnlConfig.hpp"
#include "pnlTypeDefs.hpp"
#ifndef __PNLLOGDRIVER_HPP__
#include "pnlLogDriver.hpp"
#endif
PNL_BEGIN
// FORWARDS
class Log;
// Multiplexor. Designed to be singleton object
// Distributes messages between drivers in compliance with 'level' and 'service'
// Configures all drivers (except LogDrvSystem) via Configure()
class PNL_API LogMultiplexor
{
public: // USER INTERFACE
void Configure(LogDriver::EConfCmd command, int level = eLOG_ALL,
int service = eLOGSRV_ALL);
void WriteConfiguration() const;
static LogMultiplexor& StdMultiplexor() { return *s_pStdMultiplexor; }
static void SetStdMultiplexor(LogMultiplexor *pMultiplexor)
{ s_pStdMultiplexor = pMultiplexor; }
public: // PUBLIC INTERFACE FOR LOGGING SUBSYSTEM (Log, LogDriver)
LogMultiplexor(): m_iUpdate(0) {}
~LogMultiplexor();
int AttachDriver(LogDriver* pDriver);
int AttachLogger(Log* pLog);
void DetachDriver(LogDriver* pDriver, int iDriver);
void DetachLogger(Log* pLog, int iLogger);
int iUpdate() const { return m_iUpdate; }
bool GetBDenyOutput(int *piUpdate, int level, int service);
void DriverReconfigured(LogDriver *pDriver);
void WriteString(int level, int service, const char* pStr, int strLen = -1);
private:
LogMultiplexor& operator=(const LogMultiplexor&)
{ return *this; } // deny copying
private: // DATA
static LogMultiplexor *s_pStdMultiplexor;
pnlVector<LogDriver*> m_apDriver;
pnlVector<Log*> m_apHead;
int m_iUpdate;
};
PNL_END
#endif // include guard
--------------------------------------------
pnllogmultiplexor.cpp
#include "pnlLogDriver.hpp"
#include "pnlLogMultiplexor.hpp"
PNL_USING
namespace pnl
{
LogMultiplexor* LogMultiplexor::s_pStdMultiplexor = 0;
}
void
LogMultiplexor::DriverReconfigured(LogDriver *pDriver)
{
++m_iUpdate;
}
LogMultiplexor::~LogMultiplexor()
{
int i;
for(i = m_apHead.size(); --i >= 0;)
{
if(m_apHead[i])
{
assert(0 && "All Log()s must be detached before deleting Multiplexor");
}
}
..
.....