Visual C++ and Headers

This is a discussion on Visual C++ and Headers within the C++ Programming forums, part of the General Programming Boards category; This is my first time using Visual c++ and i keep getting a link error for trying to include <string.h>. ...

  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
    zen
    zen is offline
    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
    zen
    zen is offline
    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
    zen
    zen is offline
    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

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