user6827707
user6827707

Reputation:

C++ including from the other directory doesn't work

Yes, I know there's like 100000000 questions like this on this site. I spent 2 hours lurking SO to find out what am I doing wrong. This is my projects directory tree:

enter image description here

main.cpp starts with this:

#include <iostream>
#include "XD.hpp"

(lib/XD.hpp or <XD> doesn't work as well)

I tried many other combination, I even did -I/home/frynio/Desktop/projects/sdizo1/lib, but it still doesn't work. Do you guys see what am I doing wrong here?

I know this will be massively downvoted, but I'd rather spend time working on my project rather than trying to figure out this thing.

Upvotes: 0

Views: 169

Answers (1)

Alex
Alex

Reputation: 21

It should look something like this

#include "../lib/XD.hpp"

Upvotes: 2

Related Questions