I added a path to the path environment variable |
but I cannot include the headers at that location via #include <file.h> |
g++ -o test test.cpp
for example where test.exe will be the executable created out of test.cpp source file. But make sure you're in the test.cpp directory before you do the above codeThe preprocessor searches for include files in the following order: 1. In the same directory as the file that contains the #include statement. 2. In the directories of any previously opened include files in the reverse order in which they were opened. The search starts from the directory of the include file that was opened last and continues through the directory of the include file that was opened first. 3. Along the path specified by each /I compiler option. 4. Along the paths specified by the INCLUDE environment variable. |