我收到上述全局消息链接器错误
const char* HOST_NAME = "127.0.0.1";
我不认为我已经编译了两次文件,但无论如何这是我对文件的定义。
主文件
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include "connection.hpp"
连接.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"
连接.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
有什么帮助吗?