How to make g++ search for header files in a specific directory?

A/code.cpp #include <B/file.hpp> A/a/code2.cpp #include <B/file.hpp> Compile using: g++ -I /your/source/root /your/source/root/A/code.cpp g++ -I /your/source/root /your/source/root/A/a/code2.cpp Edit: You can use environment variables to change the path g++ looks for header files. From man page: Some additional environments variables affect the behavior of the preprocessor. CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH Each variable’s value is a list of … Read more

vscode “#include errors detected. Please update your includePath

Although the question mentions Arduino, the following suggestions apply basically any time VSCode tells you to “update your includePath”. What is includePath? The includePath is an attribute in c_cpp_settings.json, which is in the .vscode folder of the main folder you have opened in VSCode using File → Open Folder. You can edit c_cpp_settings.json directly, but … Read more

python pip specify a library directory and an include directory

pip has a –global-option flag You can use it to pass additional flags to build_ext. For instance, to add a –library-dirs (-L) flag: pip install –global-option=build_ext –global-option=”-L/path/to/local” pyodbc gcc supports also environment variables: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html I couldn’t find any build_ext documentation, so here is the command line help Options for ‘build_ext’ command: –build-lib (-b) directory for … Read more

Eclipse CDT: Symbol ‘cout’ could not be resolved

Most likely you have some system-specific include directories missing in your settings which makes it impossible for indexer to correctly parse iostream, thus the errors. Selecting Index -> Search For Unresolved Includes in the context menu of the project will give you the list of unresolved includes which you can search in /usr/include and add … Read more

PHP – Failed to open stream : No such file or directory

There are many reasons why one might run into this error and thus a good checklist of what to check first helps considerably. Let’s consider that we are troubleshooting the following line: require “/path/to/file” Checklist 1. Check the file path for typos either check manually (by visually checking the path) or move whatever is called … Read more

tech