Friday, February 20. 2009how to do includes rightTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
#include <filename> [..] The named file is searched for in a sequence of implementation-dependent places. #include "filename" searches first in association with the original source file (a deliberately implementation-dependent phrase), and if that search fails, then as if in the first form. This means that it is pretty safe to assume that #include "filename" will do a search relative to the original source file as long as the compiler is running on an OS with a traditional filesystem. (Dunno of any OS where that assumption would break.) It's also what i have experienced if you use "" then it's looking relative to the file first. What i wanted to say is that you just have to remind it's not a requirement for the compiler to do it. So i still agree with your blog fully, mate Imagine that you have a C file that has to use math.h: #include <math.h> That breaks. Or let's imagine that your code is using a third-party C library that needs math.h. It'll do: #include <math.h> That breaks too. Put the blame in the case-insensitiveness of the filesystem. c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(22) : error C2039: 'acos' : is not a member of 'operator``global namespace'' c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(22) : error C2873: 'acos' : symbol cannot be used in a using-declaration c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(22) : error C2039: 'asin' : is not a member of 'operator``global namespace'' c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(22) : error C2873: 'asin' : symbol cannot be used in a using-declaration c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(23) : error C2039: 'atan' : is not a member of 'operator``global namespace'' c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\cmath(23) : error C2873: 'atan' : symbol cannot be used in a using-declaration |
Calendar
QuicksearchCategoriesBlog Administration |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||