Problem with creating an user defined function.

I've been trying to create a separate user defined function but there is no way I am able to do it. I've tried all the possible correction combination still an error remains with return type, "Return code is not 0". Please help me with that.
Header file:

#ifndef Atrial_h
#define Atrial_h
#include "Arduino.h"
class MorseWrite
{
	public :
		MorseWrite(int pin);
		void ltrA(int pin);
}
#endif

Source file:

#include "Arduino.h"
	#include "Atrial.h"
	void MorseWrite::MorseWrite(int pin)
	{
pinMode(pin, OUTPUT);
	}
void MorseWrite::ltrA(int pin)
{
	digitalWrite(pin, HIGH);
	delay(500);
	digitalWrite(pin, LOW);
	delay(500);
	digitalWrite(pin, HIGH);
	delay(1500);
	digitalWrite(pin, LOW);
}

I don't see how your question can have anything to do with the working of this website so I have suggested to the Moderator to move it to the Programming section.

I'm not an expert on C++ but I would expect that all the class functions should be in the Class definition in the header file.

...R

You're missing a semi-colon after your class definition. Constructors don't have a return type, but you have supplied one (void) - get rid of it.

Don't do anything with the hardware in your constructor - when it runs, the hardware has not been initialized. Make a begin method, put that pinmode statement in it and call it from setup.

When making a new library it is often helpful to put all of the code in one file. Then you don't have to worry about include files. Since the pin number is unlikely to change, you should store it in the object so you don't have to pass it to each member function. This is a good use of the Constructor. If someone creates a global variable of your class, the Constructor gets called before the Arduino run-time library is initialized. That is why you should not put any Arduino library calls in your Constructor and should create a 'begin' function to call from setup() to do the Arduino initialization.

/////////////// The Library Include File /////////////
class MorseWrite
{
  public :
    MorseWrite(const byte pin);
    void begin();
    void ltrA();
  private:
    byte OutPin;
};


/////////////// The Library Source File //////////////
MorseWrite::MorseWrite(const byte pin)
{
  OutPin = pin;
}


void MorseWrite::begin()
{
  digitalWrite(OutPin, LOW);
  pinMode(OutPin, OUTPUT);
}


void MorseWrite::ltrA()
{
  digitalWrite(OutPin, HIGH);
  delay(500);
  digitalWrite(OutPin, LOW);
  delay(500);
  digitalWrite(OutPin, HIGH);
  delay(1500);
  digitalWrite(OutPin, LOW);
}




////////////////  The Sketch  ///////////////////
MorseWrite MW(LED_BUILTIN);


void setup()
{
  MW.begin();
}


void loop() 
{
  MW.ltrA();
  delay(1000);
}