I've recently installed libechonest and all its dependencies, yet to include its header files (in /usr/local/include/echonest/
I have to specify the whole path, i.e. #include "/usr/local/include/echonest/Artist.h"
instead of just #include <Artist.h>
:
alexcannon$ gcc -g -o geoEchoNest geoEchoNest.c -lechonest
geoEchoNest.c:6:10: fatal error: 'Artist.h' file not found
#include "Artist.h"
Why is this? According to the GCC docs it should look in /usr/local/include
by default:
GCC looks in several different places for headers. On a normal Unix system, if you do not >instruct it otherwise, it will look for headers requested with #include in:
/usr/local/include libdir/gcc/target/version/include /usr/target/include /usr/include
How can I fix it? I have the same problem for other libraries, e.g. I have to do #include "/usr/local/include/QtCore/QDebug"
instead of include <QDebug>
so it's not just an echonest issue.
Permissions for /usr/local/include
are drwxrwxr-x
. Here is my gcc info:
alexcannon$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx- include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
I searched and found lots of similar #include
GCC questions, but the only one specifically dealing with issues finding files in /usr/local/include
was specific to XCode.
Obviously let me know if you need any more info and as always thanks in advance for the help.
The include path is not searched recursively, try this.
#include <echonest/Artist.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With