Reputation: 563
I cloned a github C++ repository. The repository is not a VS project. So I manually created a VS C++ blank project and added the files from the repo to the project. The files are not copied. This is not the problem.
The repo directory looks like this:
include\NTL\*.h
src\*.cpp
*.h
means a bunch of header files and *.cpp
means a bunch of .cpp
source files.
The problem is that the .cpp
files have #include <NTL/*.h>
and when I build, VS fails to locate the header files (No such file or directory
). Adding the path to the include
to the Include Directories in project properties didn't help.
EDIT: After some experimenting, I've found that the error has nothing to do with the prefix NTL
in #include <NTL/*.h>
but with whether the files are copied into project directory. Even though the files appear in VS project view, they must be copied into the project directory.
EDIT: The only way I've managed to get the project to compile is to put the whole NTL
directory containing header files in project directory. Include Directories and Additional Include Directories in project properties don't seem to have any effect.
Upvotes: 0
Views: 1285
Reputation: 563
All previous No such file or directory
errors were the result of some combination of:
.h
files were actually missing from NTL github repo, e.g. mach_desc.h
.The solution to the problem consists of the following:
Properties > C/C++
, add the path to the include
to Additional Include Directories
.Upvotes: 1