Click to See Complete Forum and Search --> : Error that it cannot find the .hpp
eenu
November 6th, 2006, 06:15 AM
Hi,
I have this section of code (reduced select section):
#include <FileCtrl.hpp>
#include "Pasunit.hpp"
#include <IniFiles.hpp>
#include "Registry.hpp"
#include "TCPBase.h"
#include "Main.h"
one of the files causing me grief is pasunit.hpp. My real question is though why is that in "" and the others in <>??
Carlos Martinez
November 6th, 2006, 07:01 AM
I think with " ", compiler searches in your local directory and with <> does in your inlcude_list of your makefile.
Usually, includes from the directory of the program/library you are programming uses " ", and the others (standard library, and other libraries) use <>
Hi,
I have this section of code (reduced select section):
#include <FileCtrl.hpp>
#include "Pasunit.hpp"
#include <IniFiles.hpp>
#include "Registry.hpp"
#include "TCPBase.h"
#include "Main.h"
one of the files causing me grief is pasunit.hpp. My real question is though why is that in "" and the others in <>??
Moore
November 6th, 2006, 07:23 AM
typically, the #include "hdr_filename" can be used to include headers you have composed yourself and are located in the current directory.
#include <hdr_filename> will be used to include headers that are provided in a standard place like for standard library for example.
The absolute path does not need to be specified.
MrViggy
November 6th, 2006, 11:04 AM
Both forms will search your include path for the file in question. The difference is:
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 any 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 form: This form instructs the preprocessor to search for include files first along the path specified by the /I compiler option, then, when compiling from the command line, along the path specified by the INCLUDE environment variable.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_predir_The_.23.include_Directive.asp
Viggy
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.