Reputation: 878
I wanted to separate function definitions and function headers using folders but I get a fatal error saying "x.h" was not found. The filenames provided below are just samples. Is this even possible?
This is the line I'm using:
g++ -I ./headers/ -o main2.o main2.cpp ./definitions/x.cpp
Upvotes: 0
Views: 116
Reputation: 47794
If you're sure you've correct files in correct path, one issue is :-
There shouldn't be any space after -I
and use just ./headers
g++ -I./headers -o main2.o main2.cpp ./definitions/x.cpp
^^No Space
Upvotes: 4