When I try to compile my code in VC++ I get the following 2 errors:
scheduling error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
scheduling fatal error LNK1120: 1 unresolved externals
Any ideas what these mean? I have looked on the 'net but nothing meaningful (everyone's talking about DLL files).
FYI, here's the source code:
Code:
#include <iostream>
#include <stdarg.h>
#include "scheduling.h"
#define MAXSIZE 100
using namespace std;
typedef unsigned char boolean;
// default constructor for head of list
process_list::process_list() {
m_curr = this;
m_prev = NULL;
m_next = NULL;
}
//constructor for extra nodes
process_list::process_list(process_list* prev)
{
m_prev = prev;
m_next = NULL;
}
//inserts a new process with data given
void process_list::insert(int temp_pid, int temp_tarq, int temp_prio, int temp_tncpu, int temp_cpu_burst[], int temp_IO_burst[])
{
while (m_curr->get_next() != NULL)
m_curr = m_curr->get_next();
m_curr->set_data(temp_pid, temp_tarq, temp_prio, temp_tncpu, temp_cpu_burst, temp_IO_burst);
m_curr->set_next(new process_list(m_curr));
}
//Fetch PID functions
int process_list::get_pidE1()
{
return pid;
}
int process_list::get_pid()
{
return m_curr->get_pidE1();
}
//Fetch tarq functions
int process_list::get_tarqE1()
{
return tarq;
}
int process_list::get_tarq()
{
return m_curr->get_tarqE1();
}
//Fetch Prio functions
int process_list::get_prioE1()
{
return prio;
}
int process_list::get_prio()
{
return m_curr->get_prioE1();
}
//Fetch tncpu functions
int process_list::get_tncpuE1()
{
return tncpu;
}
int process_list::get_tncpu()
{
return m_curr->get_tncpuE1();
}
//Fetch cpu_burst functions
int process_list::get_cpu_burstE1(int cpu_num)
{
return cpu_burst[cpu_num];
}
int process_list::get_cpu_burst(int cpu_num)
{
return m_curr->get_cpu_burstE1(cpu_num);
}
//Fetch IO_burst_lenth functions
int process_list::get_IO_burstE1(int IO_num)
{
return IO_burst[IO_num];
}
int process_list::get_IO_burst(int IO_num)
{
return m_curr->get_IO_burstE1(IO_num);
}
// set process information function
void process_list::set_data(int temp_pid, int temp_tarq, int temp_prio, int temp_tncpu, int temp_cpu_burst[], int temp_IO_burst[])
{
pid = temp_pid;
tarq = temp_tarq;
prio = temp_prio;
tncpu = temp_tncpu;
cpu_burst[MAXSIZE] = temp_cpu_burst[MAXSIZE];
IO_burst[MAXSIZE-1] = temp_IO_burst[MAXSIZE-1];
}
//returns a pointer to the previous process
process_list* process_list::get_prev()
{
return m_prev;
}
//returns a pointer to the next process
process_list* process_list::get_next()
{
return m_next;
}
//add a new process to the list
void process_list::set_next(process_list* process)
{
m_next = process;
}
//sets m_curr pointer back to the start of the list
void process_list::reset()
{
m_curr = this;
}
//moves m_curr to the next process in the list
void process_list::next()
{
m_curr = m_curr->get_next();
}
//moved m_curr to the previous process in the list
void process_list::prev()
{
m_curr = m_curr->get_prev();
}
//check for end
boolean process_list::is_end()
{
return m_curr->get_next() == NULL ? 1 : 0;
}
//check for biginning
boolean process_list::is_beginning()
{
return m_curr == NULL ? 1 : 0;
}
//check if any entries have been added to the list
boolean process_list::is_empty()
{
return m_curr->get_next() == m_curr->get_prev() ? 1 : 0;
}
And here's the header file:
Code:
//process list header file
//this is the interface of processlist
#include <iostream>
#define MAXSIZE 100
using namespace std;
typedef unsigned char boolean;
class process_list {
private:
process_list *m_curr, *m_next, *m_prev;
int pid; //PID = process ID code,
int tarq; //TARQ = time of arrival into the ready queue (the first time, right when it was created only!),
int prio; //PRIO = priority code,
int tncpu; //TNCPU = total number of cpu bursts of the process
int cpu_burst[MAXSIZE];
int IO_burst[MAXSIZE-1];
public:
/*Constructors*/
process_list();
process_list(process_list* prev);
/*Operations*/
void insert(int temp_pid, int temp_tarq, int temp_prio, int temp_tncpu, int temp_cpu_burst[], int temp_IO_burst[]);
/*data setting*/
int get_pid();
int get_tarq();
int get_prio();
int get_tncpu();
int get_cpu_burst(int cpu_num);
int get_IO_burst(int IO_num);
int get_pidE1();
int get_tarqE1();
int get_prioE1();
int get_tncpuE1();
int get_cpu_burstE1(int cpu_num);
int get_IO_burstE1(int IO_num);
void set_data(int temp_pid, int temp_tarq, int temp_prio, int temp_tncpu, int temp_cpu_burst[], int temp_IO_burst[]);
process_list* get_prev();
process_list* get_next();
void set_next(process_list* );
/*Movement*/
void reset();
void prev();
void next();
void end();
/*Boolean*/
boolean is_beginning();
boolean is_end();
boolean is_empty();
};