freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: #include <xxx.h> ????


From: Boris Letocha
Subject: RE: #include <xxx.h> ????
Date: Thu, 29 Jun 2000 07:59:19 +0200

Hi!

> with this, you only need to add the path to "src" to your project,
> and you can still provide an alternate set of files if you wish
> so (with an additional indirection).
>
> On the other hand, this forbids putting all source files in a single
> directory (some projects might want this ??)..
>
> Any comments ??
>
Yes :-)

If I put all src files and header files to one directory with VC project file it is easy to setup. But after I cannot simply know for which module is any *.c and *.h files. So It would be beatiful to have it in same structure as it is in you have.

It looks like I copy all to one directory and everyting will be ok also in VC.
I don't much understand why should some one change yours source files ...

For better understanding #include paradigma in VC longer explanation from MSDN:
Quoted form:
This form instructs the preprocessor to look for include files in the same directory of the file that contains the #include statement, and then in the directories of whatever files that include (#include) that file. The preprocessor then searches along the path specified by the /I compiler option, then along paths specified by the INCLUDE environment variable.

Angle-bracket form:
This form instructs the preprocessor to search for include files first along the path specified by the /I compiler option, then along the path specified by the INCLUDE environment variable.

.....My comments: But it is relative to whole project(library).

The preprocessor stops searching as soon as it finds a file with the given name. If you specify a complete, unambiguous path specification for the include file between two sets of double quotation marks (" "), the preprocessor searches only that path specification and ignores the standard directories.

If the filename enclosed in double quotation marks is an incomplete path specification, the preprocessor first searches the "parent" file's directory. A parent file is the file containing the #include directive. For example, if you include a file named file2 within a file named file1, file1 is the parent file.

Include files can be "nested"; that is, an #include directive can appear in a file named by another #include directive. For example, file2, above, could include file3. In this case, file1 would still be the parent of file2 but would be the "grandparent" of file3.

When include files are nested, directory searching begins with the directories of the parent file and then proceeds through the directories of any grandparent files. Thus, searching begins relative to the directory containing the source currently being processed. If the file is not found, the search moves to directories specified by the /I compiler option. Finally, the directories specified by the INCLUDE environment variable are searched.

Boris Letocha


reply via email to

[Prev in Thread] Current Thread [Next in Thread]