0

I have my header files for ex, header.h and I want to include in a .cpp file using <>, it is showing error as "Can not fin the file.".

I know for header files included using <>, the compiler searches them at the specified location, but how to tell the compiler to search the header files at a particular location while compiling the code.

I have tried,

g++ -I/src/include filename.cpp

but it shows same error as above.

Please suggest me the way to solve this problem.

Thanks in advance!

Pramay
  • 47
  • 4
  • 2
    You do know that a leading `/` in a path (like in `/src/include`) makes the path *absolute*? Perhaps you should try just `src/include`? – Some programmer dude Mar 14 '18 at 10:06
  • 1
    The quotation `#include "filename"` is used for the headers you define. Also it falls back to angular brackets if doesn't find anything. – Juan González Salinas Mar 14 '18 at 10:13
  • Not quite a duplicate. Question is about angled brackets. Duplicate answer only mentions -I, which won't work for code with angled brackets. – Jeffrey Sep 02 '19 at 21:39

0 Answers0