The problem is simple: I have 3 files to work with (main.cpp, complex.cpp, complex.h) which I am going to attach here:
main.cpp:
#include "complex.h"
int main(){
    Complesso c1, c2(3, 4), somma, prodotto;
    c1.set_Re(5);
    c1.set_Imm(5);
    cout << c1.get_Re() << " " << c1.get_Imm() << endl;
    cout << c2.get_Re() << " " << c2.get_Imm() << endl;
    somma = c1+c2; //c1.operator+(c2)
    prodotto = c1*c2;
    if (c1==c2)
        cout << "Uguale" << endl;
    return 0;
}
complex.cpp:
#include "complex.h"
Complesso Complesso::operator+(const Complesso C) const{
    Complesso somma;
    somma.Re = Re+C.Re;
    somma.Imm = Imm+C.Imm;
    return somma;
}
Complesso Complesso::operator*(const Complesso C) const{
    Complesso prodotto;
    prodotto.Re = Re*C.Re - Imm*C.Imm;
    prodotto.Imm = Imm*C.Re + C.Imm*Re;
    return prodotto;
}
bool Complesso::operator==(const Complesso C) const{
    return (Re==C.Re && Imm==C.Imm);
}
and finally complex.h:
#ifndef _COMPLEX_H
#define _COMPLEX_H
#include <iostream>
#include <cmath>
using namespace std;
class Complesso{
    private:
        double Re;
        double Imm;
    public:
        // Constructor
        Complesso(){};
        Complesso(const double R, const double I){Re=R; Imm=I;}; // With arguments
        // Setter
        void set_Re(const double R) {Re=R;};
        void set_Imm(const double I) {Imm=I;};
        //Getter
        double get_Re() const {return Re;};
        double get_Imm() const {return Imm;};
        // Operator functions
        Complesso operator+(const Complesso) const;
        Complesso operator*(const Complesso) const;
        bool operator==(const Complesso) const;
};
#endif
When I run the main.cpp file in vscode I get this error:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Simon\AppData\Local\Temp\ccGgcciK.o:tempCodeRunnerFile.cpp:(.text+0x15b): 
undefined reference to `Complesso::operator+(Complesso) const'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Simon\AppData\Local\Temp\ccGgcciK.o:tempCodeRunnerFile.cpp:(.text+0x192):
undefined reference to `Complesso::operator*(Complesso) const'
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Simon\AppData\Local\Temp\ccGgcciK.o:tempCodeRunnerFile.cpp:(.text+0x1c2):
undefined reference to `Complesso::operator==(Complesso) const'
collect2.exe: error: ld returned 1 exit status
So it's like vscode does not recognise the functions. The thing is that if I run the code using DEV-C++ It runs without errors.
