Hallo.
I'm going to list a few files (edited for relevance) that I cannot get to compile. All .cpp files are added to the project, and there is nothing wrong that I can identify.
Nonetheless, I am getting the three functions for Tconsole_script that are implemented in the "ftp_console.cpp" file as unresolved externals.
Can anybody see why?
My main unit file "ftpcwe_mainunit.cpp"
// start ------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include<string>
using namespace std;
#include "ftp_console.h"
#include "ftp_console_exceptions.h"
#include "ftpcwe_mainunit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Tconsole_script<string> Buffy;
}
// end --------------------------------------------------
Header file "ftp_console.h"
// start ------------------------------------------------
#if !defined(MARYHADALITTTLEWOLFITATEHERHEADOFF023)
#define MARYHADALITTTLEWOLFITATEHERHEADOFF023
#include<vcl.h>
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<dir>
#include"ftp_console_exceptions.h"
using namespace std;
template<class T>
class Tconsole_scriptublic vector<T>
{
public:
Tconsole_script():filename("",index(-1){}
virtual ~Tconsole_script(){}
virtual int& Index(){return index;}
virtual void MoveBy(int& incr);
virtual void MoveBack();
virtual void MoveNext();
protected:
T filename;
int index;
};
#endif // 'MARYHADALITTTLEWOLFITATEHERHEADOFF023' defined
// end --------------------------------------------------
cpp file "ftp_console.cpp"
// start ------------------------------------------------
#include"ftp_console.h"
template<class T>
void Tconsole_script<T>::MoveBy(int& incr)
{
if(index<0)throw EScript_exception e("MoveBy(int&) invalid on empty script"
if(index+incr<0 || index+incr>=size())throw EScript_exception e("MoveBy(int&) - array out of bounds"
index+=incr;
}
//---------------------------------------------------------------------------
template<class T>
void Tconsole_script<T>::MoveBack()
{
if(index<0)throw EScript_exception e("MoveBack() invalid on empty script"
if(index==0)throw EScript_exception e("MoveBack() takes array out of bounds"
index--;
}
//---------------------------------------------------------------------------
template<class T>
void Tconsole_script<T>::MoveNext()
{
if(index<0)throw EScript_exception e("MoveNext() invalid on empty script"
if(index==size())throw EScript_exception e("MoveNext() takes array out of bounds"
index++;
}
// end --------------------------------------------------
The file "ftp_console_exceptions.h" is present, and its .cpp file is fine & added to the project.
I'm stumped.
Any help VERY appreciated.
Cheers,
Douglas JL
Common sense is what tells you the world is flat.
I'm going to list a few files (edited for relevance) that I cannot get to compile. All .cpp files are added to the project, and there is nothing wrong that I can identify.
Nonetheless, I am getting the three functions for Tconsole_script that are implemented in the "ftp_console.cpp" file as unresolved externals.
Can anybody see why?
My main unit file "ftpcwe_mainunit.cpp"
// start ------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include<string>
using namespace std;
#include "ftp_console.h"
#include "ftp_console_exceptions.h"
#include "ftpcwe_mainunit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Tconsole_script<string> Buffy;
}
// end --------------------------------------------------
Header file "ftp_console.h"
// start ------------------------------------------------
#if !defined(MARYHADALITTTLEWOLFITATEHERHEADOFF023)
#define MARYHADALITTTLEWOLFITATEHERHEADOFF023
#include<vcl.h>
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<dir>
#include"ftp_console_exceptions.h"
using namespace std;
template<class T>
class Tconsole_scriptublic vector<T>
{
public:
Tconsole_script():filename("",index(-1){}
virtual ~Tconsole_script(){}
virtual int& Index(){return index;}
virtual void MoveBy(int& incr);
virtual void MoveBack();
virtual void MoveNext();
protected:
T filename;
int index;
};
#endif // 'MARYHADALITTTLEWOLFITATEHERHEADOFF023' defined
// end --------------------------------------------------
cpp file "ftp_console.cpp"
// start ------------------------------------------------
#include"ftp_console.h"
template<class T>
void Tconsole_script<T>::MoveBy(int& incr)
{
if(index<0)throw EScript_exception e("MoveBy(int&) invalid on empty script"
if(index+incr<0 || index+incr>=size())throw EScript_exception e("MoveBy(int&) - array out of bounds"
index+=incr;
}
//---------------------------------------------------------------------------
template<class T>
void Tconsole_script<T>::MoveBack()
{
if(index<0)throw EScript_exception e("MoveBack() invalid on empty script"
if(index==0)throw EScript_exception e("MoveBack() takes array out of bounds"
index--;
}
//---------------------------------------------------------------------------
template<class T>
void Tconsole_script<T>::MoveNext()
{
if(index<0)throw EScript_exception e("MoveNext() invalid on empty script"
if(index==size())throw EScript_exception e("MoveNext() takes array out of bounds"
index++;
}
// end --------------------------------------------------
The file "ftp_console_exceptions.h" is present, and its .cpp file is fine & added to the project.
I'm stumped.
Any help VERY appreciated.
Cheers,
Douglas JL
Common sense is what tells you the world is flat.