user5859747
user5859747

Reputation:

c++ include directory "file not found"

I'm working on getting an example run for the audioCaffe framework http://multimedia-commons.s3-website-us-west-2.amazonaws.com/?prefix=tools/audioCaffe/

The root directory of this project contains an include directory.

Except, when I navigate to tools and compile g++ caffe.cpp it throws an error:

caffe.cpp:8:10: fatal error: 'caffe/caffe.hpp' file not found

note that include/caffe/caffe.hpp exists

Upvotes: 3

Views: 17021

Answers (1)

Nacho
Nacho

Reputation: 1124

Since you mentioned using g++ caffe.cpp I assume you execute this command form where caffe.cpp file is, which is:

audioCaffe/tools/caffe.cpp

The caffe.cpp file uses #include "caffe/caffe.hpp" which is in the include directory:

audioCaffe/include/caffe/caffe.hpp

So you will need to tell the compiler where to find the headers, you do this with the -I option. Compile it with the command:

g++ -I ../include caffe.cpp

Upvotes: 3

Related Questions