0

The path to my .cpp and .h files: /home/quasiturbine/ServerProject/Network/NetworkIncludes/

There you can find TCP_Connexion.h and TCP_Connexion.cpp

In the .cpp file, I got #include "NetworkIncludes\TCP_Connexion.h" and default constructor/destructor. That's it.

G++ command:

g++ -o program -I/home/quasiturbine/ServerProject/Network/ /home/quasiturbine/ServerProject/Network/NetworkIncludes/TCP_Connexion.cpp

fatal error: /home/quasiturbine/ServerProject/Network/NetworkIncludes/TCP_Connexion.cpp:1:43: fatal error: NetworkIncludes\TCP_Connexion.h: No such file or folder #include "NetworkIncludes\TCP_Connexion.h"

What is wrong and how can I fix it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

6

The problem is, that you are using backslashes \ when you should be using forward slashes /. Backslashes in include paths are undefined behavior before C++11 and implementation defined afterwards (reference).

So change your include to

#include "NetworkIncludes/TCP_Connexion.h"

and you should be good to go.

nyronium
  • 1,258
  • 2
  • 11
  • 25