- #1
member 428835
I have the following two files stored in the folder "impl" on my Desktop, the CLion IDE and am running on a mac: main.cpp:
and then a header file Employee.h
When clicking the green triangle "run" (see the arrow in the image) I get the error the image shows (see the file structure upper left if this helps):
Any idea what I'm doing wrong? Thanks so much!
C++:
#include <iostream>
#include "Employee.h"
int main() {
Employee e1("Bradly", "E007");
Employee e2("John", "E425");
std::cout << e1.getName() << ": " << e1.getId() << "\n";
e1.setName("Brad");
std::cout << e1.getName() << ": " << e1.getId() << "\n";
std::cout << e2.getName() << ": " << e2.getId() << "\n";
return 0;
}
and then a header file Employee.h
C++:
#pragma once
#include <string>
class Employee
{
public:
Employee(std::string name, std::string id);
std::string getName() const;
std::string getId() const;
void setName(std::string name);
private:
std::string m_name;
std::string m_id;
};
When clicking the green triangle "run" (see the arrow in the image) I get the error the image shows (see the file structure upper left if this helps):
Any idea what I'm doing wrong? Thanks so much!