I am new to OOP and I have encountered a problem while writing my first code. I do not understand why I can not use one class as a part of another. And no I do not want that class to inherit another. One of the requirements is that I prevent object copying.
    #pragma once
#include<iostream>
#include<string>
using namespace std;
class Pilot 
{
public:
    Pilot(/*string x*/) 
    {
        setName();
        flight_hours = 0;
        set_status(0);
    }
    void setName(/*string x*/) 
    {
        cout<<"Unesi ime pilota: ";
        getline(cin,name);
    }
    string getName() 
    {
        return name;
    }
    void increase_flight_hours(int n) 
    {
        flight_hours += n;
    }
    int get_flight_hours() 
    {
        return flight_hours;
    }
    void set_status(bool b) 
    {
        status;
    }
    bool get_status() 
    {
        return status;
    }
    void display_pilot() 
    {
        cout << name;
        cout << "(", flight_hours, ")";
        if (status)
            cout << "-L" << endl;
        else
            cout << "-N" << endl;
    }
    Pilot (const Pilot&) = delete;
    void operator=(const Pilot&) = delete;
private:
    string name;
    int flight_hours;
    bool status;
};
#pragma once
#include"Pilot.h"
class Avion 
{
public:
    Avion ()
    {
        setName();
        set_capacity();
    }
    void setName(/*string x*/)
    {
        cout << "Unesi ime aviona: ";
        getline(cin, name);
    }
    string getName()
    {
        return name;
    }
    void set_capacity()
    {
        cout << "Unesite kapacitet aviona: ";
        cin >> capacity;
    }
    int get_capacity() 
    {
        return capacity;
    }
    Pilot get_captain() 
    {
        return captain;
    }
private:
    string name;
    Pilot captain;
    Pilot copilot;
    int capacity;
};
I get this error :
function "Pilot::Pilot(const Pilot &)" (declared at line 50 of "C:\Users\mjova\source\repos\Project1\Project1\Pilot.h") cannot be referenced -- it is a deleted function   Project1    C:\Users\mjova\source\repos\Project1\Project1\Planes.h  36
 
     
    