I'm working in Visual studio 2010. I Added a directory to Project Properties -> Linker -> General -> Additional Directories
The project compiles if I use
"file.h"
but not if i use
<file>
I'm working in Visual studio 2010. I Added a directory to Project Properties -> Linker -> General -> Additional Directories
The project compiles if I use
"file.h"
but not if i use
<file>
"" is for local files and <> are from files in the C library.
You are probably assuming that
< >
implicitly adds.h
to the end of the file name. This is not true. Whether you use< >
or" "
has no significance on the name of the file. It basically tells the implementation in which order it should traverse include directories to find the header file.To quote the standard:
An include works only if there is exists such a file. In your case it might be cause there is a file file.h but note simply file.
You probably think it should work everywhere as you might have seen it with iostream.h and iostream. This is because they are two different files which mean two different things.