hi!
i'm having problems linking what seems to prodominantly be static constants & variables within a couple of classes in a win32 dll project i'm writing.
it may be worth noting that i've actually implemented all class methods in their header files (no cpp files for classes!!) & also implemented namespaces. neither of which i've ever done before. i'm hoping this is ok!?
here's a few snippets of the code & the output from the (debug) build:
// +++++++++++++
// (EXCEPTION.H)
// +++++++++++++
#include "doctrans.h" // application definitions etc.
namespace Sector
{
namespace DataType
{
//
// exception class
//
class Exception
{
public:
void SetNumber(int iError)
{
m_iErrorCode = iError;
};
int GetNumber()
{
return m_iErrorCode;
};
void Clear()
{
m_iErrorCode = Exception::EXCEPTION_OK;
};
static Exception* Instance()
{
if (Exception::m_pInstance == NULL)
Exception::m_pInstance = new Exception;
return Exception::m_pInstance;
};
static const int EXCEPTION_OK = DTR_OK;
protected:
Exception()
{
// don't allow objects to be created directly
};
private:
static Exception* m_pInstance;
int m_iErrorCode;
};
} // DataType
} // Sector
// ++++++++++++++
// (IDATASTORE.H)
// ++++++++++++++
#include <string>
using namespace std;
namespace Sector
{
namespace Data
{
/*
****************************
idatastore interface
****************************
*/
interface IDataStore
{
public:
virtual string* ReadRecord(long lRecNo) = 0;
virtual long WriteRecord(long lRecNo, string* psWriteBuff) = 0;
virtual long CreateRecord(long lPos) = 0;
virtual long DeleteRecord(long lRecNo) = 0;
virtual long GetCurrentRecord() = 0;
virtual string* ReadField(long lRecNo, string sFieldName) = 0;
virtual long WriteField(long lRecNo, string sFieldName, string* psWriteBuff) = 0;
virtual bool Read(string sQuery = "") = 0;
virtual bool Create() = 0;
virtual bool Delete() = 0;
virtual bool Refresh() = 0;
virtual bool Flush(long min = 0, long max = -1) = 0;
virtual bool Clear() = 0;
virtual long GetOccurenceCount() = 0;
virtual string GetName();
virtual void SetName(string sName);
virtual string GetInfo();
virtual bool SetInfo(string sXMLDesc);
};
} // Data
} // Sector
// ++++++++++++++
// (TEXTPARSER.H)
// ++++++++++++++
#include <string>
#include "doctrans.h" // application definitions etc.
#include "linkedlist.h"
#include "queue.h"
#include "repository.h"
#include "exception.h"
namespace Sector
{
namespace Library
{
namespace DocumentTransformer
{
namespace Text
{
// declare used namespaces...
using namespace Sector:ataType;
/*
************************
textparser class
************************
*/
class TextParser : public IParser
{
public:
//
// constructor
//
TextParser(Repository* pRepository,
bool bProcessPrivateText)
{
m_pRepository = pRepository;
m_bProcessPrivate = bProcessPrivateText;
m_pAppException = Exception::Instance();
// initialise fake constants...
// (not really constants because not integral types)
TextParser::InitConstants();
};
//
// public iparser operations
//
virtual bool Parse(Converter* pConverter)
{
// a load of code...
};
//
// public constants
//
private:
//
// private static methods
//
static void InitConstants()
{
// necessary because it's not possible to have non-integral
// type constants initialised in a class definition...
if (TextParser::CTRL_CODE_END != "98")
{
TextParser::CTRL_CODE_EXTEND_LENGTH = "71";
TextParser::CTRL_CODE_HIGHLIGHT = "91";
TextParser::CTRL_CODE_UNDERLINE = "92";
TextParser::CTRL_CODE_PARAGRAPH_START = "95";
TextParser::CTRL_CODE_PARAGRAPH_END = "94";
TextParser::CTRL_CODE_PRE_MASK_CLAUSE = "97";
TextParser::CTRL_CODE_PRE_DICT_CLAUSE = "99";
TextParser::CTRL_CODE_END = "98";
TextParser::CTRL_CODE_PRIVATE_TEXT1 = "990";
TextParser::CTRL_CODE_PRIVATE_TEXT2 = "991";
TextParser::CTRL_CODE_PRIVATE_TEXT3 = "992";
TextParser::CTRL_CODE_PAGE_BREAK1 = "980";
TextParser::CTRL_CODE_PAGE_BREAK2 = "981";
TextParser::CTRL_CODE_PAGE_BREAK3 = "982";
}
};
//
// private methods
//
TextParser()
{
// don't allow objects to be created without parameters passed
};
__inline bool IsPrivateTextCode(string sDictCode)
{
// some code...
};
//
// private static member data
//
// (i wanted these to be constants but they're not integral types
// so not allowed!?!?)
static string CTRL_CODE_EXTEND_LENGTH;
static string CTRL_CODE_HIGHLIGHT;
static string CTRL_CODE_UNDERLINE;
static string CTRL_CODE_PARAGRAPH_START;
static string CTRL_CODE_PARAGRAPH_END;
static string CTRL_CODE_PRE_MASK_CLAUSE;
static string CTRL_CODE_PRE_DICT_CLAUSE;
static string CTRL_CODE_END;
static string CTRL_CODE_PRIVATE_TEXT1;
static string CTRL_CODE_PRIVATE_TEXT2;
static string CTRL_CODE_PRIVATE_TEXT3;
static string CTRL_CODE_PAGE_BREAK1;
static string CTRL_CODE_PAGE_BREAK2;
static string CTRL_CODE_PAGE_BREAK3;
//
// private member data
//
Repository* m_pRepository;
bool m_bProcessPrivate;
Exception* m_pAppException;
};
} // Text
} // DocumentTransformer
} // Library
} // Sector
// ++++++++++++++
// (DICTPARSER.H)
// ++++++++++++++
#include <string>
#include "doctrans.h" // application definitions etc.
#include "iparser.h"
#include "textparser.h"
#include "linkedlist.h"
#include "queue.h"
#include "repository.h"
#include "converter.h"
#include "exception.h"
namespace Sector
{
namespace Library
{
namespace DocumentTransformer
{
namespace Text
{
// declare used namespaces...
using namespace Sector:ataType;
using namespace Sector:ata;
/*
************************
dictparser class
************************
*/
class DictParser : public IParser
{
public:
//
// constructor
//
DictParser(Repository* pRepository)
{
m_pRepository = pRepository;
m_pAppException = Exception::Instance();
// initialise fake constants...
// (not really constants because not integral types)
DictParser::InitConstants();
};
//
// public iparser operations
//
virtual bool Parse(Converter* pConverter)
{
// a load of code...
};
//
// public constants
//
static const int FIELD_JUSTIFY_LEFT = 76; // ascii 'L'
static const int FIELD_JUSTIFY_RIGHT = 82; // ascii 'R'
private:
//
// private static methods
//
static void InitConstants()
{
// necessary because it's not possible to have non-integral
// type constants initialised in a class definition...
if (DictParser::CTRL_CODE_END != "98")
{
DictParser::CTRL_CODE_END = "98";
DictParser::CTRL_CODE_PRIVATE_TEXT1 = "990";
DictParser::CTRL_CODE_PRIVATE_TEXT2 = "991";
DictParser::CTRL_CODE_PRIVATE_TEXT3 = "992";
DictParser::CTRL_CODE_PAGE_BREAK1 = "980";
DictParser::CTRL_CODE_PAGE_BREAK2 = "981";
DictParser::CTRL_CODE_PAGE_BREAK3 = "982";
DictParser::CTRL_CODE_HIGHLIGHT = "91";
DictParser::CTRL_CODE_UNDERLINE = "92";
DictParser:REMASK_SIGNIFIER = "~~";
}
};
//
// private methods
//
DictParser()
{
// don't allow objects to be created without parameters passed
};
__inline bool IsPreMaskRecord(string* psText)
{
if (psText->find(DictParser:REMASK_SIGNIFIER) == -1)
return false;
return true;
};
__inline bool IsPrivateTextCode(string sDictCode)
{
// some code...
};
__inline bool IsPageBreak(string sDictCode)
{
// some code...
};
//
// private static member data
//
// (same as class above. wanted these to be constants)
static string CTRL_CODE_END;
static string CTRL_CODE_PRIVATE_TEXT1;
static string CTRL_CODE_PRIVATE_TEXT2;
static string CTRL_CODE_PRIVATE_TEXT3;
static string CTRL_CODE_PAGE_BREAK1;
static string CTRL_CODE_PAGE_BREAK2;
static string CTRL_CODE_PAGE_BREAK3;
static string CTRL_CODE_HIGHLIGHT;
static string CTRL_CODE_UNDERLINE;
static string PREMASK_SIGNIFIER;
//
// private member data
//
Repository* m_pRepository;
Exception* m_pAppException;
};
} // Text
} // DocumentTransformer
} // Library
} // Sector
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------ Build started: Project: doctrans, Configuration: Debug Win32 ------
Compiling...
main.cpp
-+- COMPILING filepath...\stdinc.h
-+- COMPILING filepath...\resource.h
-+- COMPILING filepath...\doctrans.h
-+- COMPILING filepath...\linkedlist.h
-+- COMPILING filepath...\queue.h
-+- COMPILING filepath...\exception.h
-+- COMPILING filepath...\guiapplication.h
-+- COMPILING filepath...\iapplication.h
-+- COMPILING filepath...\uniface.h
-+- COMPILING filepath...\idatastore.h
-+- COMPILING filepath...\idocumenttransformer.h
-+- COMPILING filepath...\repository.h
-+- COMPILING filepath...\textitem.h
-+- COMPILING filepath...\converter.h
-+- COMPILING filepath...\iparser.h
-+- COMPILING filepath...\textconverter.h
-+- COMPILING filepath...\textparser.h
-+- COMPILING filepath...\dictconverter.h
-+- COMPILING filepath...\dictparser.h
-+- COMPILING filepath...\texttransformer.h
-+- COMPILING i:\program\user\richard millen\sectornet\projects\text processor\doctrans - utext\31-10-2004\doctrans\main.cpp
Linking...
Creating library Debug/doctrans.lib and object Debug/doctrans.exp
main.obj : error LNK2001: unresolved external symbol "private: static class Sector:ataType::Exception * Sector:ataType::Exception::m_pInstance" (?m_pInstance@Exception@DataType@Sector@@0PAV123@A)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Sector:ata::IDataStore::SetInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?SetInfo@IDataStore@Data@Sector@@UAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Sector:ata::IDataStore::GetInfo(void)" (?GetInfo@IDataStore@Data@Sector@@UAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Sector:ata::IDataStore::SetName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?SetName@IDataStore@Data@Sector@@UAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Sector:ata::IDataStore::GetName(void)" (?GetName@IDataStore@Data@Sector@@UAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_EXTEND_LENGTH" (?CTRL_CODE_EXTEND_LENGTH@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRE_MASK_CLAUSE" (?CTRL_CODE_PRE_MASK_CLAUSE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_END" (?CTRL_CODE_END@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRE_DICT_CLAUSE" (?CTRL_CODE_PRE_DICT_CLAUSE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PARAGRAPH_END" (?CTRL_CODE_PARAGRAPH_END@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PARAGRAPH_START" (?CTRL_CODE_PARAGRAPH_START@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_UNDERLINE" (?CTRL_CODE_UNDERLINE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_HIGHLIGHT" (?CTRL_CODE_HIGHLIGHT@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK3" (?CTRL_CODE_PAGE_BREAK3@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK2" (?CTRL_CODE_PAGE_BREAK2@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK1" (?CTRL_CODE_PAGE_BREAK1@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT3" (?CTRL_CODE_PRIVATE_TEXT3@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT2" (?CTRL_CODE_PRIVATE_TEXT2@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT1" (?CTRL_CODE_PRIVATE_TEXT1@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_UNDERLINE" (?CTRL_CODE_UNDERLINE@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_HIGHLIGHT" (?CTRL_CODE_HIGHLIGHT@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_END" (?CTRL_CODE_END@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser:REMASK_SIGNIFIER" (?PREMASK_SIGNIFIER@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK3" (?CTRL_CODE_PAGE_BREAK3@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK2" (?CTRL_CODE_PAGE_BREAK2@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK1" (?CTRL_CODE_PAGE_BREAK1@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT3" (?CTRL_CODE_PRIVATE_TEXT3@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT2" (?CTRL_CODE_PRIVATE_TEXT2@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT1" (?CTRL_CODE_PRIVATE_TEXT1@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
Debug/doctrans.dll : fatal error LNK1120: 29 unresolved externals
Build log was saved at "file://i:\Program\User\Richard Millen\Sectornet\Projects\Text Processor\Doctrans - utext\31-10-2004\Doctrans\Debug\BuildLog.htm"
doctrans - 30 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
i've looked all over the place for similar problems but can't find them!!
does anyone think they might know what this is??
i'm having problems linking what seems to prodominantly be static constants & variables within a couple of classes in a win32 dll project i'm writing.
it may be worth noting that i've actually implemented all class methods in their header files (no cpp files for classes!!) & also implemented namespaces. neither of which i've ever done before. i'm hoping this is ok!?
here's a few snippets of the code & the output from the (debug) build:
// +++++++++++++
// (EXCEPTION.H)
// +++++++++++++
#include "doctrans.h" // application definitions etc.
namespace Sector
{
namespace DataType
{
//
// exception class
//
class Exception
{
public:
void SetNumber(int iError)
{
m_iErrorCode = iError;
};
int GetNumber()
{
return m_iErrorCode;
};
void Clear()
{
m_iErrorCode = Exception::EXCEPTION_OK;
};
static Exception* Instance()
{
if (Exception::m_pInstance == NULL)
Exception::m_pInstance = new Exception;
return Exception::m_pInstance;
};
static const int EXCEPTION_OK = DTR_OK;
protected:
Exception()
{
// don't allow objects to be created directly
};
private:
static Exception* m_pInstance;
int m_iErrorCode;
};
} // DataType
} // Sector
// ++++++++++++++
// (IDATASTORE.H)
// ++++++++++++++
#include <string>
using namespace std;
namespace Sector
{
namespace Data
{
/*
****************************
idatastore interface
****************************
*/
interface IDataStore
{
public:
virtual string* ReadRecord(long lRecNo) = 0;
virtual long WriteRecord(long lRecNo, string* psWriteBuff) = 0;
virtual long CreateRecord(long lPos) = 0;
virtual long DeleteRecord(long lRecNo) = 0;
virtual long GetCurrentRecord() = 0;
virtual string* ReadField(long lRecNo, string sFieldName) = 0;
virtual long WriteField(long lRecNo, string sFieldName, string* psWriteBuff) = 0;
virtual bool Read(string sQuery = "") = 0;
virtual bool Create() = 0;
virtual bool Delete() = 0;
virtual bool Refresh() = 0;
virtual bool Flush(long min = 0, long max = -1) = 0;
virtual bool Clear() = 0;
virtual long GetOccurenceCount() = 0;
virtual string GetName();
virtual void SetName(string sName);
virtual string GetInfo();
virtual bool SetInfo(string sXMLDesc);
};
} // Data
} // Sector
// ++++++++++++++
// (TEXTPARSER.H)
// ++++++++++++++
#include <string>
#include "doctrans.h" // application definitions etc.
#include "linkedlist.h"
#include "queue.h"
#include "repository.h"
#include "exception.h"
namespace Sector
{
namespace Library
{
namespace DocumentTransformer
{
namespace Text
{
// declare used namespaces...
using namespace Sector:ataType;
/*
************************
textparser class
************************
*/
class TextParser : public IParser
{
public:
//
// constructor
//
TextParser(Repository* pRepository,
bool bProcessPrivateText)
{
m_pRepository = pRepository;
m_bProcessPrivate = bProcessPrivateText;
m_pAppException = Exception::Instance();
// initialise fake constants...
// (not really constants because not integral types)
TextParser::InitConstants();
};
//
// public iparser operations
//
virtual bool Parse(Converter* pConverter)
{
// a load of code...
};
//
// public constants
//
private:
//
// private static methods
//
static void InitConstants()
{
// necessary because it's not possible to have non-integral
// type constants initialised in a class definition...
if (TextParser::CTRL_CODE_END != "98")
{
TextParser::CTRL_CODE_EXTEND_LENGTH = "71";
TextParser::CTRL_CODE_HIGHLIGHT = "91";
TextParser::CTRL_CODE_UNDERLINE = "92";
TextParser::CTRL_CODE_PARAGRAPH_START = "95";
TextParser::CTRL_CODE_PARAGRAPH_END = "94";
TextParser::CTRL_CODE_PRE_MASK_CLAUSE = "97";
TextParser::CTRL_CODE_PRE_DICT_CLAUSE = "99";
TextParser::CTRL_CODE_END = "98";
TextParser::CTRL_CODE_PRIVATE_TEXT1 = "990";
TextParser::CTRL_CODE_PRIVATE_TEXT2 = "991";
TextParser::CTRL_CODE_PRIVATE_TEXT3 = "992";
TextParser::CTRL_CODE_PAGE_BREAK1 = "980";
TextParser::CTRL_CODE_PAGE_BREAK2 = "981";
TextParser::CTRL_CODE_PAGE_BREAK3 = "982";
}
};
//
// private methods
//
TextParser()
{
// don't allow objects to be created without parameters passed
};
__inline bool IsPrivateTextCode(string sDictCode)
{
// some code...
};
//
// private static member data
//
// (i wanted these to be constants but they're not integral types
// so not allowed!?!?)
static string CTRL_CODE_EXTEND_LENGTH;
static string CTRL_CODE_HIGHLIGHT;
static string CTRL_CODE_UNDERLINE;
static string CTRL_CODE_PARAGRAPH_START;
static string CTRL_CODE_PARAGRAPH_END;
static string CTRL_CODE_PRE_MASK_CLAUSE;
static string CTRL_CODE_PRE_DICT_CLAUSE;
static string CTRL_CODE_END;
static string CTRL_CODE_PRIVATE_TEXT1;
static string CTRL_CODE_PRIVATE_TEXT2;
static string CTRL_CODE_PRIVATE_TEXT3;
static string CTRL_CODE_PAGE_BREAK1;
static string CTRL_CODE_PAGE_BREAK2;
static string CTRL_CODE_PAGE_BREAK3;
//
// private member data
//
Repository* m_pRepository;
bool m_bProcessPrivate;
Exception* m_pAppException;
};
} // Text
} // DocumentTransformer
} // Library
} // Sector
// ++++++++++++++
// (DICTPARSER.H)
// ++++++++++++++
#include <string>
#include "doctrans.h" // application definitions etc.
#include "iparser.h"
#include "textparser.h"
#include "linkedlist.h"
#include "queue.h"
#include "repository.h"
#include "converter.h"
#include "exception.h"
namespace Sector
{
namespace Library
{
namespace DocumentTransformer
{
namespace Text
{
// declare used namespaces...
using namespace Sector:ataType;
using namespace Sector:ata;
/*
************************
dictparser class
************************
*/
class DictParser : public IParser
{
public:
//
// constructor
//
DictParser(Repository* pRepository)
{
m_pRepository = pRepository;
m_pAppException = Exception::Instance();
// initialise fake constants...
// (not really constants because not integral types)
DictParser::InitConstants();
};
//
// public iparser operations
//
virtual bool Parse(Converter* pConverter)
{
// a load of code...
};
//
// public constants
//
static const int FIELD_JUSTIFY_LEFT = 76; // ascii 'L'
static const int FIELD_JUSTIFY_RIGHT = 82; // ascii 'R'
private:
//
// private static methods
//
static void InitConstants()
{
// necessary because it's not possible to have non-integral
// type constants initialised in a class definition...
if (DictParser::CTRL_CODE_END != "98")
{
DictParser::CTRL_CODE_END = "98";
DictParser::CTRL_CODE_PRIVATE_TEXT1 = "990";
DictParser::CTRL_CODE_PRIVATE_TEXT2 = "991";
DictParser::CTRL_CODE_PRIVATE_TEXT3 = "992";
DictParser::CTRL_CODE_PAGE_BREAK1 = "980";
DictParser::CTRL_CODE_PAGE_BREAK2 = "981";
DictParser::CTRL_CODE_PAGE_BREAK3 = "982";
DictParser::CTRL_CODE_HIGHLIGHT = "91";
DictParser::CTRL_CODE_UNDERLINE = "92";
DictParser:REMASK_SIGNIFIER = "~~";
}
};
//
// private methods
//
DictParser()
{
// don't allow objects to be created without parameters passed
};
__inline bool IsPreMaskRecord(string* psText)
{
if (psText->find(DictParser:REMASK_SIGNIFIER) == -1)
return false;
return true;
};
__inline bool IsPrivateTextCode(string sDictCode)
{
// some code...
};
__inline bool IsPageBreak(string sDictCode)
{
// some code...
};
//
// private static member data
//
// (same as class above. wanted these to be constants)
static string CTRL_CODE_END;
static string CTRL_CODE_PRIVATE_TEXT1;
static string CTRL_CODE_PRIVATE_TEXT2;
static string CTRL_CODE_PRIVATE_TEXT3;
static string CTRL_CODE_PAGE_BREAK1;
static string CTRL_CODE_PAGE_BREAK2;
static string CTRL_CODE_PAGE_BREAK3;
static string CTRL_CODE_HIGHLIGHT;
static string CTRL_CODE_UNDERLINE;
static string PREMASK_SIGNIFIER;
//
// private member data
//
Repository* m_pRepository;
Exception* m_pAppException;
};
} // Text
} // DocumentTransformer
} // Library
} // Sector
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------ Build started: Project: doctrans, Configuration: Debug Win32 ------
Compiling...
main.cpp
-+- COMPILING filepath...\stdinc.h
-+- COMPILING filepath...\resource.h
-+- COMPILING filepath...\doctrans.h
-+- COMPILING filepath...\linkedlist.h
-+- COMPILING filepath...\queue.h
-+- COMPILING filepath...\exception.h
-+- COMPILING filepath...\guiapplication.h
-+- COMPILING filepath...\iapplication.h
-+- COMPILING filepath...\uniface.h
-+- COMPILING filepath...\idatastore.h
-+- COMPILING filepath...\idocumenttransformer.h
-+- COMPILING filepath...\repository.h
-+- COMPILING filepath...\textitem.h
-+- COMPILING filepath...\converter.h
-+- COMPILING filepath...\iparser.h
-+- COMPILING filepath...\textconverter.h
-+- COMPILING filepath...\textparser.h
-+- COMPILING filepath...\dictconverter.h
-+- COMPILING filepath...\dictparser.h
-+- COMPILING filepath...\texttransformer.h
-+- COMPILING i:\program\user\richard millen\sectornet\projects\text processor\doctrans - utext\31-10-2004\doctrans\main.cpp
Linking...
Creating library Debug/doctrans.lib and object Debug/doctrans.exp
main.obj : error LNK2001: unresolved external symbol "private: static class Sector:ataType::Exception * Sector:ataType::Exception::m_pInstance" (?m_pInstance@Exception@DataType@Sector@@0PAV123@A)
main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Sector:ata::IDataStore::SetInfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?SetInfo@IDataStore@Data@Sector@@UAE_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Sector:ata::IDataStore::GetInfo(void)" (?GetInfo@IDataStore@Data@Sector@@UAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Sector:ata::IDataStore::SetName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?SetName@IDataStore@Data@Sector@@UAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Sector:ata::IDataStore::GetName(void)" (?GetName@IDataStore@Data@Sector@@UAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_EXTEND_LENGTH" (?CTRL_CODE_EXTEND_LENGTH@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRE_MASK_CLAUSE" (?CTRL_CODE_PRE_MASK_CLAUSE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_END" (?CTRL_CODE_END@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRE_DICT_CLAUSE" (?CTRL_CODE_PRE_DICT_CLAUSE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PARAGRAPH_END" (?CTRL_CODE_PARAGRAPH_END@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PARAGRAPH_START" (?CTRL_CODE_PARAGRAPH_START@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_UNDERLINE" (?CTRL_CODE_UNDERLINE@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_HIGHLIGHT" (?CTRL_CODE_HIGHLIGHT@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK3" (?CTRL_CODE_PAGE_BREAK3@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK2" (?CTRL_CODE_PAGE_BREAK2@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PAGE_BREAK1" (?CTRL_CODE_PAGE_BREAK1@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT3" (?CTRL_CODE_PRIVATE_TEXT3@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT2" (?CTRL_CODE_PRIVATE_TEXT2@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text::TextParser::CTRL_CODE_PRIVATE_TEXT1" (?CTRL_CODE_PRIVATE_TEXT1@TextParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_UNDERLINE" (?CTRL_CODE_UNDERLINE@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_HIGHLIGHT" (?CTRL_CODE_HIGHLIGHT@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_END" (?CTRL_CODE_END@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser:REMASK_SIGNIFIER" (?PREMASK_SIGNIFIER@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK3" (?CTRL_CODE_PAGE_BREAK3@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK2" (?CTRL_CODE_PAGE_BREAK2@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PAGE_BREAK1" (?CTRL_CODE_PAGE_BREAK1@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT3" (?CTRL_CODE_PRIVATE_TEXT3@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT2" (?CTRL_CODE_PRIVATE_TEXT2@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
main.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Sector::Library:ocumentTransformer::Text:ictParser::CTRL_CODE_PRIVATE_TEXT1" (?CTRL_CODE_PRIVATE_TEXT1@DictParser@Text@DocumentTransformer@Library@Sector@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
Debug/doctrans.dll : fatal error LNK1120: 29 unresolved externals
Build log was saved at "file://i:\Program\User\Richard Millen\Sectornet\Projects\Text Processor\Doctrans - utext\31-10-2004\Doctrans\Debug\BuildLog.htm"
doctrans - 30 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
i've looked all over the place for similar problems but can't find them!!
does anyone think they might know what this is??