Thread: Error with include files

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    204

    Error with include files

    I have some source programs. When compiled they give me the following error:
    Code:
    Compiling...
    foo.cpp
    e:\source\foo\foo.hpp(14) : fatal error C1083: Cannot open include file: 'haa.h': No such file or directory
    Line 14 of the file 'foo.hpp' looks like this:
    Code:
    #include "haa.h"
    Can anyone tell me what causes this type of error and how I can go about fixing it?
    Last edited by thetinman; 10-11-2005 at 04:15 PM.

  2. #2
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282
    Where is your haa.h?

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    If your "haa.h" header is in the same dir as the file calling it, it's a total mystery.
    That's why I think your problem is that your "haa.h" header file is not in the same dir as the file calling it.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    204
    "haa.h" is in the directory "e:\source\common."

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Then you need to add a search path to the compiler
    -Ie:\source\common

    Or if you have an IDE, find out how to achieve the same effect using that (probably something along the lines of project settings->compiler->pre-processor)
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Aug 2005
    Posts
    204
    Why can't I just add the 'haa.h' to my project? Thanks by the way. That last suggestion did the trick.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. precompiled header file
    By George2 in forum C++ Programming
    Replies: 20
    Last Post: 04-07-2008, 08:14 AM
  2. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  3. include files that are'nt in compiler's directory
    By vaibhav in forum C++ Programming
    Replies: 10
    Last Post: 03-25-2006, 11:45 AM
  4. Include files
    By disruptivetech in forum C++ Programming
    Replies: 7
    Last Post: 07-12-2005, 09:52 AM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 02:50 AM