#pragma once
#include <iostream>
struct task {
int id;
int dur;
int s_time;
int e_time;
int *dep;
// Adding three extra variables
int ls;
int lf;
int *f_deps;
};
class Schedular {
task * arr; // array for tasks
int *n_d; // dependencies list
int *n_f;
int n; // Total tasks
public:
Schedular();
Schedular(task *ts, int n);
void setTaskDuration();
void set_nth_TaskDuration(int i, int t);
void printTaskDependencyList(int i);
void completionTime();
};
I am getting this error when I try to run this program,
1 2
1>Source.obj : error LNK2019: unresolved external symbol "public: __thiscall Schedular::~Schedular(void)" (??1Schedular@@QAE@XZ) referenced in function _main
1>E:\Visual Studio\Projects\Project12\Debug\Project12.exe : fatal error LNK1120: 1 unresolved externals
Now, from what I have learned, you get this error if you haven't defined Default Constructor but I have done that clearly... Can anyone help me resolve this issue? Thank you
It doesn't really make sense for the exact code you've posted, but normally that error (complaining about a missing destructor) would be caused by having declared the dtor in the class but never actually defining it. You probably need a dtor for your class since you have dynamically allocated memory to clean up.
If you're programming for C++11 or better you should never use the macro NULL; use the keyword nullptr instead.
BTW, I don't know if it's on purpose or not, but "scheduler" doesn't usually have an 'a' in it.