I get the above message linker error for a global
const char* HOST_NAME = "127.0.0.1";
I don't think that I have compiled some files twice but here's my definition of the files anyway.
main.cpp
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include "connection.hpp"
connection.cpp
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <arpa/inet.h>
#include "connection.hpp"
connection.hpp
#ifndef __connection__
#define __connection__
#include <unistd.h>
#include <netinet/in.h>
const int BUFFSIZE = sysconf(_SC_PAGESIZE); //Define page size
const char* HOST_NAME = "127.0.0.1"; //Local host
//Definition of a class
#endif
Any help?