include-path
Why do projects use the -I include switch given the dangers?
What legitimate reasons are there for -I over -iquote? -I is standardized (at least by POSIX) while -iquote isn’t. (Practically, I’m using -I because tinycc (one of the compilers I want my project to compile with) doesn’t support -iquote.) How do projects manage with -I given the dangers? You’d have the includes wrapped in a … Read more
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
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
Cannot find corecrt.h: $(UniversalCRT_IncludePath) is wrong
For Visual Studio 2017 I had to: Run Visual Studio Installer. Select Modify button. Go to “Individual Components” tab. Scroll down to “Compilers, build tools and runtimes”. Tick “Windows Universal CRT SDK”. Install.
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
What are the GCC default include directories?
In order to figure out the default paths used by gcc/g++, as well as their priorities, you need to examine the output of the following commands: For C: gcc -xc -E -v – For C++: gcc -xc++ -E -v – The credit goes to Qt Creator team.
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