Thread: Visual C++ and Headers

  1. #1
    Unregistered
    Guest

    Visual C++ and Headers

    This is my first time using Visual c++ and i keep getting a link error for trying to include <string.h>. How do you use header files like string.h, math.h, ctype.h and so on in this compiler???

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    If you're getting a link error then the headers aren't causing the error. Are your libraries installed in the correct location? They should be in \Microsoft Visual Studio\VC98\LIB. Also what type of project have you created?
    zen

  3. #3
    Unregistered
    Guest
    It doesn't install <string.h> when you install Visual c++? I think i made a win32 consol app for the project. I am used to Metrowerks and specifying #include <string.h> is all you have to do. Do i have to do something special to use basic header files in Visual c++?

  4. #4
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    string h is installed along with all the other headers when you install VC++. Can you post your error message?
    zen

  5. #5
    Unregistered
    Guest
    Linking...
    LINK : fatal error LNK1104: cannot open file "ctype.h"
    Error executing link.exe.

    Now its telling me this. I created a new win32 console app and used the same code and the program works fine. I just dont get it.

  6. #6
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    It should only produce this message when you've tried to link to a library that it can't find, it's not that it can't find the header file you can never link to header files. At a guess I'd say your project settings have become messed up.
    zen

Popular pages Recent additions subscribe to a feed