I have one class called TextFile.
I have two other classes that I want to extend TextFile: Correlation, and Rotation.
I'm getting linking erros whenever I try to define the constructors for both these objects. I don't know what's going on, but I also don't really know the best way to organized 3 headers files (one for each class) 3 cpp Source files (one for each class) and of course a source file for the main program. I fiqure if I can nail down organizing the files, espeically how to #include correctly, and use inclusion guards correctly, I fiqure I can attribute the problems to my code, and not how they call link together.
I've tried tons of stuff, but I fiqure I'll post what I have for code now, (trimmed down to save space on LQ of course...)
TextFile.h
Code:
#ifndef TEXTFILE_H
#define TEXTFILE_H
#include <string>
class TextFile {
protected:
// members
public:
TextFile();
TextFile(std::string);
// other methods
};
#endif
TextFile.cpp
Code:
#include "TextFile.h"
#include <fstream>
// method definitions
Rotation.h
Code:
// Rotation Class Interface
#ifndef ROTATION_H
#define ROTATION_H
#include "TextFile.h"
class Rotation : public TextFile {
private:
// members
public:
Rotation();
// other methods
};
#endif
Rotation.cpp
Code:
// Rotation Class Definition
#include "Rotation.h"
Rotation::Rotation() {
;
}
Correllation.h
Code:
// Correlation Class Interface
#ifndef CORRELATION_H
#define CORRELATION_H
#include "TextFile.h"
class Correlation : public TextFile {
private:
// members
public:
Correlation();
// other methods
};
#endif
Correllation.cpp
Code:
// Correlation Class Definition
#include "Correlation.h"
Correlation::Correlation() {
;
}
void Correlation::Correlate() {
;
}
--------------------------------------------------
I havent really defined anything in Rotation.cpp or Correllation.cpp yet, as I fiqure after I learn how to work with inheritance in C++ and multiple files and I can get back to CODING.
I'm currently in the lab at school here working on really really mismanaged windows boxes (I run slackware at home) and I havent tested out my code at home. Yet thisis with BloodShed DevC++, which uses minigw, and my teacher of course has a windows box at home, so I wouldnt be suprised if I get them same errors, and it's not the IDE's fault.
Please assist, Thank you very much. Screw ATI.