'collect2.exe: error: ld returned 1 exit status ERROR

#include using namespace std;

#include using namespace std;

class Employee {

public: int InpID; float salary; Employee(int ID) { InpID = ID; salary = 34; } Employee(); };

class Programmmer : public Employee {

public: Programmmer(); int LanguageCode; Programmmer(int ID) { InpID = ID; LanguageCode = 8; }

void getData() { cout << InpID << endl; } };

int main() { Employee harry(1); cout << harry.salary << endl; Programmmer Jason(5); Jason.getData(); return 0; }

This is my code while running in vscode I am getting an error of undefined reference to `Employee::Employee()' collect2.exe: error: ld returned 1 exit status



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source