STL and customized headers??

This is a discussion on STL and customized headers?? within the C++ Programming forums, part of the General Programming Boards category; I'm working on a project for a C++ class, and the purpose is to rewrite a certain bit of code ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Question STL and customized headers??

    I'm working on a project for a C++ class, and the purpose is to rewrite a certain bit of code using the STL (i'm using the Microsoft Visual C++ 6.0 compiler). I know about using the standard headers (#include<string> and all that) but i am puzzled with what to do if i need a header file that is not in the STL. I'm sure this is a very basic question and that i'm just overlooking something, but i'm not sure what it is. (if it isn't painfully obvious already, i'm still very new to the STL and C++ in general)

    Thanks!

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    Code:
    #include <string>
    #include "other-file.h"
    the first command looks for "string" in the compiler's library. the second looks for "other-file.h" in your current directory

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    ....and if its not in your compiler make sure you put the library in the current directory....

    and in VC++ if its an old c header, then you drop the .c off the end, thus (like you had), <string>, etc.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    2
    Thanks for your replies...i've tried using the "other-header.h" implementation before...the problem that occurs is i have a program that runs perfectly...no problems, no worries...but as soon as i decide to use a header not in the standard template library, and i add it as recommended (the header files are always in the same directory as the program) i end up with a whole mess of errors i've never seen before (for example, the most common one i got was "cout: ambiguous symbol"). Any further suggestions?

    Thanks!

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21