Not detecting file in other directory
I am working with C++ and have '#include "../include/Exceptions.h"' at the top of my code, and linter insists that the file doesn't exist even though it does. I am running the most up to date version and using the C++ grammar. When I compile with GCC in the terminal, it compiles fine. I am running High Sierra 10.13.3 and when I run "gcc --version", I get:
"Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin"
and in the developer pane, I found:
"{"execPath":"/usr/local/Cellar/gcc/7.3.0_1/bin/g++-7","gccIncludePaths":" ","gccSuppressWarnings":false,"gccDefaultCFlags":"-c -Wall","gccDefaultCppFlags":"-c -Wall -std=c++11","gccErrorLimit":-1,"gccErrorString":"error","gccWarningString":"warning","gccNoteString":"note","compileCommandsFile":"./build/compile_commands.json"}" (Not sure if this is needed)
Hi nagyj2,
The problem is that you need to tell gcc-linter separately where the include folder is - you can see from the developer pane output that:
"gccIncludePaths": ""
You can modify this either in the package settings, or locally with a JSON file as described under "File/Project-Specific settings" at linter-gcc. One word of warning is that it expands ./ from the project root folder. If like me you have multiple projects open in atom at once you may find it easier to expand from the active file folder, which you can do using -/.
Hope that helps!