delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/26/09:45:22

From: Ho-Jin Dan <naturalis AT cais DOT kaist DOT ac DOT kr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with GCC under Win95!?!
Date: Tue, 26 May 1998 22:20:38 +0900
Organization: KAIST
Lines: 58
Message-ID: <356AC1A6.6AA3EC93@cais.kaist.ac.kr>
References: <356999D4 DOT 626D8E7E AT metronet DOT de>
NNTP-Posting-Host: casad4.kaist.ac.kr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

hmm... another getch question is on air... ^^;
getch is not a ansi member. in other word, <conio.h> is not included in the
gnu library.
i think getch() is useful in many ways.
ok... you can make a getch function such that

#include <termio.h>
#include <sys/ioctl.h>

int getch() {
   struct termio o, n;
   char c;

   ioctl(0, TCGETA, &o);
   ioctl(0, TCGETA, &n);

   n.c_lflag &= ~(ICANON | ECHO);
   n.c_cc[VMIN] = 1;
   n.c_cc[VTIME]= 0;

   ioctl(0, TCSETA, &n);
    while(read(0, &c, 1) <= 0);
   ioctl(0, TCSETA, &o);

   return (int)c;
}

Lennart Marien wrote:

> Hi!
> I have a problem compiling my DJGPP-C Programs under WIn95!
> I tried the following simple code:
>
> //TEST.C
>
> main(void)
> {
> printf("BLABLABLA\n");
> getch();
> };
>
> gcc test.c
>
> GCC compiles, but WINDOWS gives me an error message:
> general protection fault
>
> The same happens under RHIDE on WIn95!
> I also noticed that all my precompiled programs(all compiled under DOS)
> don?t run on WIn95.My first thought was that WIN95 and CWSDPMI would
> have problems working with each other.So I deletet *every* copy of
> all CWS-parts from my HD and restarted the Computer.
> Unfortunately the error still happens.
> What can I do?Is there a troubleshooting FAQ for the GCC program itself?
>
> Thank you in advance!

 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019