T
Thomas Barth
Hi,
I was wondering if someone had any insight to what I am doing wrong. I
ve got a class with two methods that call static methods of another
class. When compiling my sourcecodes I get the error `expected
unqualified-id before "." token` for the two static function calls:
....
void V1Drawing::drawLine (double x1, double y1, double x2, double y2) {
DPOne.draw_a_line(x1, y1, x2, y2); ###error###
}
void V1Drawing::drawCircle (double x, double y, double r) {
DPOne.draw_a_circle(x, y, r); ###error###
}
....
---DPOne.h---
#ifndef DP1_H_
#define DP1_H_
class DPOne {
public:
DPOne();
virtual ~DPOne();
static void draw_a_line (double x1, double y1, double x2, double y2);
static void draw_a_circle (double x, double y, double r);
};
#endif /*DP1_H_*/
---/DPOne.h---
---DPOne.cpp---
#include "DPOne.h"
DPOne:
POne() {
}
DPOne::~DPOne() {
}
void DPOne::draw_a_line(double x1, double y1, double x2, double y2) {
...
}
void DPOne::draw_a_circle(double x, double y, double r) {
...
}
---/DPOne.cpp---
I use gcc 4.0.3 on a Linux system. Any idea what the problem is?
Thomas B
I was wondering if someone had any insight to what I am doing wrong. I
ve got a class with two methods that call static methods of another
class. When compiling my sourcecodes I get the error `expected
unqualified-id before "." token` for the two static function calls:
....
void V1Drawing::drawLine (double x1, double y1, double x2, double y2) {
DPOne.draw_a_line(x1, y1, x2, y2); ###error###
}
void V1Drawing::drawCircle (double x, double y, double r) {
DPOne.draw_a_circle(x, y, r); ###error###
}
....
---DPOne.h---
#ifndef DP1_H_
#define DP1_H_
class DPOne {
public:
DPOne();
virtual ~DPOne();
static void draw_a_line (double x1, double y1, double x2, double y2);
static void draw_a_circle (double x, double y, double r);
};
#endif /*DP1_H_*/
---/DPOne.h---
---DPOne.cpp---
#include "DPOne.h"
DPOne:
}
DPOne::~DPOne() {
}
void DPOne::draw_a_line(double x1, double y1, double x2, double y2) {
...
}
void DPOne::draw_a_circle(double x, double y, double r) {
...
}
---/DPOne.cpp---
I use gcc 4.0.3 on a Linux system. Any idea what the problem is?
Thomas B