Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[4583] 컴파일 에러...include 되있는데도 없다고 나옵니다..
천승환 [] 1594 읽음    2004-07-23 18:21
안녕하세요.

Borland C++의 Help에 나오는 예제인데, 컴파일 해보면,

Cannot conver 'void *' to 'int *' in function main()
Call to undefined function 'bioscom' in function main()..
Call to undefined function 'cprintf' in function main()..

이런 에러가 나옵니다.

분명히 include 되있는데 왜 안되죠?

Turbo C++를 설치해서 해봐도 똑같네요..

OS는 WinXP Pro입니다.

조언 부탁드립니다.

-----------------------------------------------------------
/* bioscom example */



/*
    This example can be used to communicate between
    two PCs via a null modem cable.
    The example is specific to COM1.  The appropriate values
    for COM2 are included in this example for the convenience
    of switching the code to work with COM2.

*/
#include  <bios.h>
#include  <conio.h>
#include  <dos.h>

#define DTR         0x01    // Data Terminal Ready
#define RTS         0x02    // Ready To Send       
#define COM1PORT    0x0000  // Pointer to Location of COM1 port
#define COM2PORT    0x0002  // Pointer to Location of COM2 port
#define COM1        0
#define COM2        1
#define DATA_READY  0x100
#define FALSE       0
#define TRUE        !FALSE

#define SETTINGS ( 0xE0 | 0x00 | 0x02 | 0x00)  // 9600,N,7,1

int main( void )
{
  int     in,
          out,
          status,
          DONE    = FALSE,
      far *RS232_Addr;

  /*  Determine port location of COM1.
      0x40:0x00 = COM1 I/O port address
      0x40:0x02 = COM2 I/O port address
  */
  RS232_Addr = MK_FP( 0x0040, COM1PORT );
  if( !*RS232_Addr )
    return -1;

  bioscom( 0, SETTINGS, COM1 );
  cprintf( "... BIOSCOM [ESC] to exit ...\n" );

  while( !DONE )
  {
    /*  Reset DTR and RTS to prepare for send/receive of
        next character.
    */
    outportb( *RS232_Addr + 4, DTR | RTS );

    /*  Get status of com port.
    */
    status = bioscom( 3, 0, COM1 );

    if( status & DATA_READY )

      /*  There's a character on the port.  Get it and echo.
      */

      if( (out = bioscom( 2, 0, COM1 ) & 0x7F) != 0 )
        putch( out );

    if( kbhit() )

      /*  Key has been struck.  Get it and send to port.
      */
      if( (in = getch()) == '\x1B' )

        /* User pressed ESCAPE.  Don't send to port.
        */
        DONE = TRUE;

      else

        /*  Send character to com port.
        */
        bioscom( 1, in, COM1 );
  }
  return 0;
}



+ -

관련 글 리스트
4583 컴파일 에러...include 되있는데도 없다고 나옵니다.. 천승환 1594 2004/07/23
4586     Re:컴파일 에러...include 되있는데도 없다고 나옵니다.. Starlet 1707 2004/07/24
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.