Conio.h not working in VC++ 6.0

[blue]I have vc++ 6. SP5 and when i include the conio.h file say a command like

c= getch();

then i always get heaps of errors
[/blue]
[red]
' : is not a member of 'std'
c:program filesmicrosoft visual studiovc98include_stddef.h(132) : error C2868: 'size_t' : illegal syntax for using-declaration; expected qualified-name
c:program filesmicrosoft visual studiovc98include_stddef.h(133) : error C2874: using-declaration causes a multiple declaration of 'wint_t'
c:program filesmicrosoft visual studiovc98include_stddef.h(92) : see declaration of 'wint_t'
c:program filesmicrosoft visual studiovc98include_stddef.h(134) : error C2039: 'wctype_t' : is not a member of 'std'
c:program filesmicrosoft visual studiovc98include_stddef.h(134) : error C2868: 'wctype_t' : illegal syntax for using-declaration; expected qualified-name
c:program filesmicrosoft visual studiovc98includeconio.h(137) : warning C4229: anachronism used : modifiers on data are ignored
c:program filesmicrosoft visual studiovc98includeconio.h(139) : warning C4229: anachronism used : modifiers on data are ignored
[/red][blue]
i think i may have a corrupt _stddef.h file and a conio.h one. Does any1 know what da problem is or where i could download some "safe" vc++ 6.0 libraries.
[/blue]

Comments

  • post the code snippet that contains the includes that you use and whether it is a *.c or *.cpp file.
  • The code i use in my header files is always.
    [blue]
    #include
    #include
    using namespace std;
    main()
    {
    textcolor(WHITE);
    cout<<"This SHOULD be white
    ";
    return 0;
    }
    [/blue]
  • : The code i use in my header files is always.
    : [blue]
    : #include
    : #include
    : using namespace std;
    : main()
    : {
    : textcolor(WHITE);
    : cout<<"This SHOULD be white
    ";
    : return 0;
    : }
    : [/blue]
    :

    [blue]Your example is ok -- my compiler just complains that it doesn't know what textcolor() and WHITE are. But it doesn't produce any of the errors you posted earlier.

    What version of Windows are you running? I use both W2K and XP.

    Check the paths contained in Tools | Options | Directories. My compiler has these. If yours are the same then I really have no idea why you are getting those errors. You might try reinstalling. [/blue]
    [code]
    C:Program FilesMicrosoft Visual StudioVC98INCLUDE
    C:Program FilesMicrosoft Visual StudioVC98MFCINCLUDE
    C:Program FilesMicrosoft Visual StudioVC98ATLINCLUDE
    [/code]

  • The conio file does exist. Microsoft I believe caps the
    .h files. For instance string is "String.h". If you include
    header files with iso standard #include works
    #include may not because of the case sensitivity.

    I assume you are trying to use getch(); which is specific to
    Borland however not really. You could include conio and use the
    C pointer reference to getch(); such as _getch.

    With ms visual 6.0 I think you can find getch() by _getch
    in the search for section. cin.get() works to
    Bryce
    : [blue]I have vc++ 6. SP5 and when i include the conio.h file say a command like
    :
    : c= getch();
    :
    : then i always get heaps of errors
    : [/blue]
    : [red]
    : ' : is not a member of 'std'
    : c:program filesmicrosoft visual studiovc98include_stddef.h(132) : error C2868: 'size_t' : illegal syntax for using-declaration; expected qualified-name
    : c:program filesmicrosoft visual studiovc98include_stddef.h(133) : error C2874: using-declaration causes a multiple declaration of 'wint_t'
    : c:program filesmicrosoft visual studiovc98include_stddef.h(92) : see declaration of 'wint_t'
    : c:program filesmicrosoft visual studiovc98include_stddef.h(134) : error C2039: 'wctype_t' : is not a member of 'std'
    : c:program filesmicrosoft visual studiovc98include_stddef.h(134) : error C2868: 'wctype_t' : illegal syntax for using-declaration; expected qualified-name
    : c:program filesmicrosoft visual studiovc98includeconio.h(137) : warning C4229: anachronism used : modifiers on data are ignored
    : c:program filesmicrosoft visual studiovc98includeconio.h(139) : warning C4229: anachronism used : modifiers on data are ignored
    : [/red][blue]
    : i think i may have a corrupt _stddef.h file and a conio.h one. Does any1 know what da problem is or where i could download some "safe" vc++ 6.0 libraries.
    : [/blue]
    :

  • : The conio file does exist. Microsoft I believe caps the
    : .h files. For instance string is "String.h". If you include
    : header files with iso standard #include works
    : #include may not because of the case sensitivity.
    :

    file names are case-insensive, so "string.h" is the same as "String.h".

    Also, and can both be used because they are completly different. is the STL string class. is the old c-style string functions, such as strcmp() strcpy(), etc. VC++ 6.0 does not support , which replaced .
  • : : The conio file does exist. Microsoft I believe caps the
    : : .h files. For instance string is "String.h". If you include
    : : header files with iso standard #include works
    : : #include may not because of the case sensitivity.
    : :
    :
    : file names are case-insensive, so "string.h" is the same as "String.h".
    :
    : Also, and can both be used because they are completly different. is the STL string class. is the old c-style string functions, such as strcmp() strcpy(), etc. VC++ 6.0 does not support , which replaced .
    :
    I realize they are different. #ifndef #define #endif. Without these
    you can not always use what is considered standard, and confusion
    can occur on different systems and compilers.

    I have found backward compatibility to be there with ms vc++ even though
    it is not used much these days. The new 64+ bit coding is great acheivements so do not get me wrong.

    It was a simple and backward question. However whatever the programmer
    wants to use is up to them.
    Bryce
    P.S. Please look at my posting. Do you have any ideas what the problem
    is?
  • : i think i may have a corrupt _stddef.h file and a conio.h one. Does any1 know what da problem is or where i could download some "safe" vc++ 6.0 libraries.


    If you have a legal version of the compiler then just reinstalle it from the CD that you purchased.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories