I have a problem! It shows this error:
"C:\Users\User\AppData\Roaming\JetBrains\CLion 2018.2.4\bin\cmake\win\bin\cmake.exe" --build C:\Users\User\CLionProject\HospitalTest\cmake-build-debug --target HospitalTest -- -j 2
[ 50%] Linking CXX executable HospitalTest.exe
CMakeFiles\HospitalTest.dir/objects.a(main.cpp.obj): In function `main':
C:/Users/User/CLionProject/HospitalTest/main.cpp:9: undefined reference to `CHospitalWard::CHospitalWard()'
C:/Users/User/CLionProject/HospitalTest/main.cpp:23: undefined reference to `CHospitalWard::OnAdd()'
C:/Users/User/CLionProject/HospitalTest/main.cpp:24: undefined reference to `CHospitalWard::OnDelRegNum()'
C:/Users/User/CLionProject/HospitalTest/main.cpp:25: undefined reference to `CHospitalWard::OldestPatient()'
C:/Users/User/CLionProject/HospitalTest/main.cpp:26: undefined reference to `CHospitalWard::OnPrint()'
C:/Users/User/CLionProject/HospitalTest/main.cpp:27: undefined reference to `CHospitalWard::IsInRegNum()'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\HospitalTest.dir\build.make:85: HospitalTest.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:72: CMakeFiles/HospitalTest.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:84: CMakeFiles/HospitalTest.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:117: HospitalTest] Error 2
Code:
///////////////////////////////
#pragma once
#include "Patient.h"
#include <string>
using namespace std;
class CHospitalWard
{
private:
string m_name;
int m_br;
CPatient *m;
public:
CHospitalWard();
CHospitalWard(string, int);
~CHospitalWard(){delete []m;}
void OnAdd();
void OnDelRegNum();
void OnPrint();
int IsInRegNum();
void OldestPatient();
string name_access() {return m_name;}
int br_access() {return m_br;}
};
There are declared like this:
cout<<"Generating..."<<endl;
CHospitalWard f;
int c;
string s;