CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2006
    Location
    UK
    Posts
    4

    Error that it cannot find the .hpp

    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 <>??

  2. #2
    Join Date
    Sep 2001
    Location
    Bilbao (spain)
    Posts
    110

    Re: Error that it cannot find the .hpp

    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 <>

    Quote Originally Posted by eenu
    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 <>??

  3. #3
    Join Date
    May 2005
    Posts
    112

    Re: Error that it cannot find the .hpp

    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.

  4. #4
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Error that it cannot find the .hpp

    Both forms will search your include path for the file in question. The difference is:
    Quote Originally Posted by 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 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/de..._Directive.asp

    Viggy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured