Thread: #include help...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    118

    #include help...

    Hey!

    I've never really had to bother with this before, but I have some headers that need to use another header. Thing is, they are looking for a header higher up in the hierarchy. For example, lets say ineedsomething.h needs to link to hereiam.h, and the file setup is like this:

    ../folder/hereiam.h
    ../folder/anotherfolder/ineedsomething.h

    Would I still just use #include "hereiam.h"?

    Thanks!
    FlyingIsFun1217

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    It depends on how your project/makefile/command line is setup. What IDE do you use if any?

    If you are going to be including files from directories other than the one the file is in, then you can usually add an additional include directory to the project options.

    If this is a one time thing, and you know the file will be in the directory above, you can use #include "../hereiam.h".

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    Ok, I'm pretty sure that the IDE will link to it correctly if its in a project.

    Thanks!
    FlyingIsFun1217

    ps: I use C::B

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 06:23 AM
  2. Socket programming
    By kahad in forum C Programming
    Replies: 3
    Last Post: 12-14-2006, 04:37 PM
  3. MFC include BS
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 10-31-2005, 12:44 PM
  4. help with finding lowest number entered
    By volk in forum C++ Programming
    Replies: 12
    Last Post: 03-22-2003, 01:21 PM
  5. MFC Assertion Failure
    By maxthecat in forum Windows Programming
    Replies: 5
    Last Post: 08-01-2002, 09:58 AM