Thread: Can't Find Conio.h?

  1. #1
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    Question Can't Find Conio.h?

    What can I do without conio.h? Any alternatives? Its in its file directory but It doesn't see it. What's wrong with this picture?

  2. #2
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ?

    can someone post their source code from the conio.h header file?

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    8
    Here is the source in my conio.h

    Code:
    /*  conio.h
    
        Direct MSDOS console input/output.
    
        Copyright (c) 1987, 1991 by Borland International
        All Rights Reserved.
    */
    
    #if !defined(__CONIO_H)
    #define __CONIO_H
    
    #if !defined(__DEFS_H)
    #include <_defs.h>
    #endif
    
    #define _NOCURSOR      0
    #define _SOLIDCURSOR   1
    #define _NORMALCURSOR  2
    
    struct text_info {
        unsigned char winleft;
        unsigned char wintop;
        unsigned char winright;
        unsigned char winbottom;
        unsigned char attribute;
        unsigned char normattr;
        unsigned char currmode;
        unsigned char screenheight;
        unsigned char screenwidth;
        unsigned char curx;
        unsigned char cury;
    };
    
    enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
    
    #if !defined(__COLORS)
    #define __COLORS
    
    enum COLORS {
        BLACK,          /* dark colors */
        BLUE,
        GREEN,
        CYAN,
        RED,
        MAGENTA,
        BROWN,
        LIGHTGRAY,
        DARKGRAY,       /* light colors */
        LIGHTBLUE,
        LIGHTGREEN,
        LIGHTCYAN,
        LIGHTRED,
        LIGHTMAGENTA,
        YELLOW,
        WHITE
    };
    #endif
    
    #define BLINK       128 /* blink bit */
    
    extern   int _Cdecl directvideo;
    extern   int _Cdecl _wscroll;
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    void        _Cdecl clreol( void );
    void        _Cdecl clrscr( void );
    void        _Cdecl gotoxy( int __x, int __y );
    int         _Cdecl wherex( void );
    int         _Cdecl wherey( void );
    int         _Cdecl getch( void );
    int         _Cdecl getche( void );
    int         _Cdecl kbhit( void );
    int         _Cdecl putch( int __c );
    
    #ifndef _PORT_DEFS
    int         _Cdecl inp( unsigned __portid );
    unsigned    _Cdecl inpw( unsigned __portid );
    int         _Cdecl outp( unsigned __portid, int __value );
    unsigned    _Cdecl outpw( unsigned __portid, unsigned __value );
    unsigned char _Cdecl inportb( int __portid );
    void        _Cdecl outportb( int __portid, unsigned char __value );
    #endif  /* !_PORT_DEFS */
    
    int         _Cdecl inport( int __portid );
    void        _Cdecl outport( int __portid, int __value );
    
    void        _Cdecl delline( void );
    int         _Cdecl gettext( int __left, int __top,
                                int __right, int __bottom,
                                void *__destin);
    void        _Cdecl gettextinfo (struct text_info *__r );
    void        _Cdecl highvideo( void );
    void        _Cdecl insline( void );
    void        _Cdecl lowvideo( void );
    int         _Cdecl movetext( int __left, int __top,
                                 int __right, int __bottom,
                                 int __destleft, int __desttop );
    void        _Cdecl normvideo( void );
    int         _Cdecl puttext( int __left, int __top,
                                int __right, int __bottom,
                                void *__source );
    void        _Cdecl textattr( int __newattr );
    void        _Cdecl textbackground( int __newcolor );
    void        _Cdecl textcolor( int __newcolor );
    void        _Cdecl textmode( int __newmode );
    void        _Cdecl window( int __left, int __top, int __right, int __bottom);
    
    void        _Cdecl _setcursortype( int __cur_t );
    char * _Cdecl cgets( char *__str );
    int         _Cdecl cprintf( const char *__format, ... );
    int         _Cdecl cputs( const char *__str );
    int         _Cdecl cscanf( const char *__format, ... );
    char * _Cdecl getpass( const char *__prompt );
    int         _Cdecl ungetch( int __ch );
    
    #ifndef _PORT_DEFS
    #define _PORT_DEFS
    
        /* These are in-line functions.  These prototypes just clean up
           some syntax checks and code generation.
         */
    unsigned char _Cdecl    __inportb__( int __portid );
    unsigned int _Cdecl     __inportw__( int __portid );
    void        _Cdecl      __outportb__( int __portid, unsigned char __value );
    void        _Cdecl      __outportw__( int __portid, unsigned int __value );
    
    #define inportb         __inportb__
    #define inportw         __inportw__
    #define outportb        __outportb__
    #define outportw        __outportw__
    
    #define inp( portid )      __inportb__( portid )
    #define outp( portid,v )  (__outportb__( portid,v ), (int)_AL)
    #define inpw( portid )     __inportw__( portid )
    #define outpw( portid,v ) (__outportw__( portid,v ), (unsigned)_AX)
    
    #endif  /* _PORT_DEFS */
    
    #ifdef __cplusplus
    }
    #endif
    
    #endif  /* __CONIO_H */

  4. #4
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    I've had it the whole time but It just can't open conio.h? It's Borland 5.5, conio.h came with the compiler it's just that it doesn't open it? Can anybody help?

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    if

    #include <conio.h>

    doesn't work, try

    #include "conio.h"

    Just a thought.

  6. #6
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Please don't post the contents of a header, they're virtually useless.
    #include <conio.h>

    doesn't work, try

    #include "conio.h"
    This won't help either, I'm afraid.

    drdroid, is this Borland 5.5 you're having trouble with? If so, you need to editor two text files in the Borland directory (*.cfg) and basically configure the include directory. The instructions are in the link I gave you earlier.
    http://cplus.about.com/library/weekly/aa031502a.htm
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  7. #7
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ?

    what am I supposed to edit into it? It came with conio.h but it doesn't run it.

  8. #8
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Have you read the link?
    Look:
    http://cplus.about.com/library/weekly/aa031502b.htm
    Step 6: A configuration file, bcc32.cfg, which tells the compiler where to find include files must be created. This can be done using Notepad. Create a the document shown below and save it as c:\Borland\BCC55\Bin\bcc32.cfg

    Step 7: A configuration file, ilink32.cfg, which tells the compiler where to find library files must be created. This can be done using Notepad. Create a the document shown below and save it as c:\Borland\BCC55\Bin\ilink32.cfg
    If you have installed Borland in another directory (ie not the one specified above), make sure you put the two *.cfg files in _your_ Borland's bin directory
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  9. #9
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    yah...

    I had already configured that, i tested it it works... it just can't open conio.h.

  10. #10
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    What do you mean _it_ can't find it? Can you compile this, if not post (cut/paste) the compiler errors.
    Code:
    #include <conio.h>
    
    int main(void)
    {
        getch();
        return 0;
    }
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  11. #11
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    Code:
    Unable to open include file 'conio.h'
    Called to unidentified function 'getch()' in function 'main()'

  12. #12
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    OK, now can you post the full path name to bcc32.exe and the contents of bcc32.cfg (found in the same directory as the exe). I'm running low on options here though, providing you've followed the instructions correctly
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  13. #13
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    #1 E:\PROGRAMS\Borland 5\Bin

    #2 -I"E:\PROGRAMS\Borland 5\Include"
    -I"E:\PROGRAMS\Borland 5\Lib"

  14. #14
    Student drdroid's Avatar
    Join Date
    Feb 2002
    Location
    Montreal, Quebec
    Posts
    669

    ...

    Anything wrong with it hammer?

  15. #15
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Well, I can't give you a definate answer, but I can tell you this:

    On my setup, if I rename my conio.h file, I get a different error when compiling to the one you gave.

    If I change the directory on the -I option to point to a non-existance directory, then I get the same error as you. So the problem is finding the directory, not just the file.

    Now, you shouldn't need two -I options, the Lib one should be -L.

    Double check your directory namings in the bcc32.cfg file.

    Other than that, and retracing the install procedure, I'm all out of options.

    [edit]Example of mine:
    -I".;e:\borland\bcc55\include"
    -L".;e:\borland\bcc55\lib"
    -O1
    -v
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. How to find O of threads ?
    By jabka in forum C Programming
    Replies: 3
    Last Post: 03-11-2008, 12:25 PM
  3. ld.exe: cannot find -l-lstdc++
    By Tonto in forum Tech Board
    Replies: 3
    Last Post: 04-10-2007, 11:20 PM
  4. how do u find 2nd largest number??
    By juancardenas in forum C Programming
    Replies: 8
    Last Post: 02-14-2003, 08:28 AM
  5. Q: Recursion to find all paths of a maze
    By reti in forum C Programming
    Replies: 7
    Last Post: 11-26-2002, 09:28 AM