undefined symbols error, cannot figure out why
A program I'm writing won't compile because it says the symbols are
undefined. I defined the symbols, but it still seems to not work.
g++ on Mac OS X outputs the following when I try and compile:
Undefined symbols:
"server::run()", referenced from:
_main in ccsfY9ID.o
"Queue::~Queue()", referenced from:
server::~server()in ccsfY9ID.o
"server::server()", referenced from:
_main in ccsfY9ID.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Here's the .h file for server:
#include <iostream>
#include <ctime>
#ifndef SERVER
#define SERVER
#include "Client.h"
#include "LQueue.h"
#include "JSTimer.h"
const int NUM_CATEGORIES = 5;
class server
{
public:
server();
void run();
void display(ostream & out);
void service(int & busyTimeRemaining);
void checkForNewClient();
private:
int myLengthOfSimulation;
double myArrivalRate;
int myServicePercent[NUM_CATEGORIES];
int myClientsReceived;
double myTotalWaitingTime;
JSTimer myTimer;
Queue myIncomingClients;
};
#endif
I won't even bother including the matching .cpp file because they
clearly match the declaration. If more code is needed to figure this
out, let me know. But this baffles me.
--
Jason