Thread: Why?

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    4

    Why?

    Ok i am using VS.NET 2003 and i cannot include <iostream.h>,

    Code:
    c:\Documents and Settings\Neil\My Documents\School\COMP_352\assign4\GRBFSM.CPP(1) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
    graphutil.cpp
    Thats the error i get. I jst started using VS.NET 2003, before i was using the 2002 version which had no problems including it. I really don't get why i cannot include it.... Do i have to change some settings or something? Does anyone have a clue about what im doing wrong?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    You should now be using
    Code:
    #include <iostream>
    using namespace std;
    The language has moved on, so I guess your latest compiler has finally dropped the old way of doing things.
    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.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Aw, too bad. Now you have to do things the right way.
    My best code is written with the delete key.

  4. #4
    Registered User
    Join Date
    Jun 2004
    Posts
    4
    Ok thanks guys, thats actually what i thought. I guess VS.NET 2003 is different from the older version i was using. But im still getting weird errors i don't understand. Like these:

    Code:
    Compiling...
    Grbfsm.cpp
    c:\Documents and Settings\Neil\My Documents\School\COMP_352\assign4\GRMAT.H(17) : warning C4101: 'j' : unreferenced local variable
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2146: syntax error : missing ';' before identifier 'Length'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST::DWORD' : missing storage-class or type specifiers
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST::Length' : missing storage-class or type specifiers
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(53) : error C2146: syntax error : missing ';' before identifier 'GetPrevLink'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(53) : error C2433: 'WINAPI' : 'inline' not permitted on data declarations
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(55) : error C2440: 'return' : cannot convert from 'LPLINK' to 'int'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(56) : error C2617: 'GetPrevLink' : inconsistent return statement
            c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(53) : see declaration of 'GetPrevLink'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(58) : error C2146: syntax error : missing ';' before identifier 'GetNextLink'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(58) : error C2433: 'WINAPI' : 'inline' not permitted on data declarations
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(58) : error C2086: 'LPLINK WINAPI' : redefinition
            c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(53) : see declaration of 'WINAPI'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(60) : error C2440: 'return' : cannot convert from 'LPLINK' to 'int'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(61) : error C2617: 'GetNextLink' : inconsistent return statement
            c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(58) : see declaration of 'GetNextLink'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(63) : error C2146: syntax error : missing ';' before identifier 'GetHeadOfList'
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(63) : error C2433: 'WINAPI' : 'inline' not permitted on data declarations
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(63) : error C2086: 'LPLINK WINAPI' : redefinition
    ect....
    Why are these showing up? This is what i include:

    Code:
    #include <iostream>
    #include <stdlib.h>
    using namespace std;
    should i
    Code:
    #include <stdlib>
    instead of with the .h? But if i do i get an error saying it cannot be found. Man im so confused. :S

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > #include <stdlib.h>
    All of the standard C header files lose the .h and begin with a c

    So
    #include <cstdlib>
    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
    Jun 2004
    Posts
    4
    Nevermind i figured out it was a file i was missing that was giving all these errors. It works fine now, i guess im just to use to using Java. Oh well, i learn from mistakes.

Popular pages Recent additions subscribe to a feed