Compiler erkennt Member nicht als solches an



  • Hallo allerseits,
    Ich bin nun schon seit geraumer Zeit mit der Fehlersuche beschäftigt. Leider finde ich keine Lösung. Der Compiler liefert mir folgende Fehlermeldung:

    .\Stretch.cpp(24) : error C2039: 'lenght' : is not a member of 'PropSim::Stretch'
    d:\0000praktikum\propsim\propsim\Stretch.h(15) : see declaration of 'PropSim::Stretch'

    Die ensprechende Stretch.cpp sieht folgendermaßen aus:

    namespace PropSim
    {
    	Stretch::Stretch(Drawing::Point startPointOfStretch, int lengthOfStretch, Direction direction)
    	{
    		this->startPoint = startPointOfStretch;
    		this->StretchDirection = direction;
    		this->length = lengthOfStretch;
    		if(this->StretchDirection == Direction::X)
    		{
    			if(this->length <= 0)
    			{
    				this->area = Rectangle(this->startPoint.X - 1, this->startPoint.Y - 1, this->length + 2, 3);
    			}
    			else
    			{
    				this->area = Rectangle(this->startPoint.X - 1 - this->length, this->startPoint.Y - 1, 2 - this->length, 3);
    			}
    		}
    		else if(this->StretchDirection == Direction::Y)
    		{
    			if(this->lenght <= 0)
    			{
    				this->area = Rectangle(this->startPoint.X - 1, this->startPoint.Y - 1, 2, this->length + 3);
    			}
    			else
    			{
    				this->area = Rectangle(this->startPoint.X - 1, this->startPoint.Y - 1 - this->length, 2, 3 - this->length);
    			}
    		}
    	}
    .
    .
    .
    }
    

    Stretch.h:

    #pragma once
    
    #include "Interface.h"
    
    using namespace System;
    
    namespace PropSim
    {
    	/// Gibt die Richtung eines Stretches an.
    	/* Nimmt den Wert X für horizontale Stretches an, Den Wert Y für Vertikanle Stretches*/
    	public enum class Direction{X, Y};
    
    	ref class Stretch
    	{
    	public:
    		Stretch(Drawing::Point startPointOfStretch, int lengthOfStretch, Direction direction);
    		Stretch(const Stretch %);
    
    		/// Enthält die Richtung des Stretches.
    		Direction StretchDirection;
    
    	private:
    		int length;
    		System::Drawing::Point startPoint;
    		System::Drawing::Rectangle^ area;
    
    	public:
    		/// Enthält die Länge des Stretches.
    		property int Length;
    		property Rectangle^ Area;
    	};
    }
    

    Was mich besonders verwirrt ist dass der Compiler erst das fünfte auftreten von this->length bemäkelt.
    Schonmal Danke für die Hilfe,
    Matthias



  • lenght != length



  • Danke!
    War ja eigentlich klar daß es so was ist. Aber ich schaffs immer wieder 3 Sunden nach 2 vertauschten Buchstaben zu suchen ohne si zu finden.
    Matthias.


Anmelden zum Antworten