Context:
I am current learning c/c++ compiling on my raspberry pi b+ model (started last week), but having trouble using a header file inside a object file.
File locations:
main.cpp - ~/src/c++/projects/web_server
http_socket.o - ~/src/c++/web
g++ output for g++ -o webserver ~/src/c++/web/http_socket.o -std=c++0x main.cpp
main.cpp:3:25: fatal error: http_socket.h: No such file or directory compilation terminated.
main.cpp
#include "http_socket.h"
int main() { return 0; }
http_socket.cpp
#include "http_socket.h"
#include <string>
using namespace std;
http_responce::http_responce(string status_Code, string date, string server, string content_Type, string content_Length) {
Status_Code = status_Code;
Date = date;
Server = server;
Content_Type = content_Type;
Content_Length = content_Length;
}
http_socket.h
#ifndef HTTP_SOCKET_H
#define HTTP_SOCKET_H
#include <string>
using namespace std;
class http_responce
{
public:
string Status_Code;
string Date;
string Server;
string Content_Type;
string Content_Length;
http_responce(string status_Code, string date, string server, string content_Type, string content_Length);
private:
protected:
};
#endif
Addition note:
I am very new to this language and accustomed to using an IDE, so please forgive me if it is something very trivial that I have missed.