Hello, everyone! It's been a long time using C++ and I have a link problem.
This is the code...
#include <iostream>
#include "libc++/pcslib.h"
int main()
{
std::cout << "About to load the server and all the clients." << std::endl;
Pcs serverProcess("server");
Pcs clientProcess("client");
serverProcess.Join();
clientProcess.Join();
std::cout << "After joining with processes." << std::endl;
return 0;
}
The included file pcslib.h is:
#include <unistd.h>
#include <stdio.h>
#include <iostream>
#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
class Pcs {
private:
int pcsid;
int status;
public:
Pcs();
Pcs(char *fichier);
void Fork(char *fichier);
int Join();
void Detruit();
};
There's a cpp file, pcsfile.cpp, that implements the public methods. When I'm passing the first block of code to the compiler (g++), I'm having this message and I don't know why. Can you help me?
Undefined first referenced
symbol in file
Pcs::Join() /var/tmp//ccsCx3jl.o
Pcs:: Pcs(char*) /var/tmp//ccsCx3jl.o
ld: fatal: Symbol referencing errors. No output written to loader
collect2: ld returned 1 exit status