C++ Kein geeigneter Standardkonstruktor verfügbar( 2 Klassen )?
Ich habe eine Klasse point erstellt die 3 float werte enthält und eine Klasse face die 3 point werte enthält, doch irgendetwas ist falsch. Ich finde den Fehler nicht. Bitte helft mir.
Fehler:
Code:
IoSphere.hpp:
#pragma once
#include <iostream>
#include <cmath>
class point {
private:
static int anzPoints;
float x;
float y;
float z;
public:
point(float x_, float y_, float z_);
float getX() const;
float getY() const;
float getZ() const;
int getAnzPoints() const;
void print();
void setX(float x_);
void setY(float y_);
void setZ(float z_);
};
class face {
private:
static int anzFaces;
point a;
point b;
point c;
public:
face(point a_, point b_, point c_);
point getA() const;
point getB() const;
point getC() const;
int getAnzFaces() const;
void print();
void setA(float a_);
void setB(float b_);
void setC(float c_);
};
IoSphere.cpp:
#pragma once
#include "IoSphere.hpp"
int point::anzPoints = 0; int face::anzFaces = 0;
point::point(float x_, float y_, float z_) { x = x_; y = y_; z = z_; anzPoints++; }
//.... hier stehen alle Methoden von point
face::face(point a_, point b_, point c_) {
a = a_;
b = b_;
c = c_;
anzFaces++;
} //.... Methoden von face noch nicht initialisiert
