Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #126434

Re: Good C compiler for WIN64

Subject Re: Good C compiler for WIN64
Newsgroups comp.lang.c
References <2293394508@f153.n1.z21.fsxnet> <AoGdnYFSy_qHruHHnZ2dnUU7_8zNnZ2d@giganews.com>
From bartc <bc@freeuk.com>
Message-ID <CrXeC.576756$eO2.362944@fx34.am4> (permalink)
Organization virginmedia.com
Date 2018-02-08 12:32 +0000

Show all headers | View raw


On 08/02/2018 11:22, Robbie Hatley wrote:
> 
> On 2/6/2018 3:14 PM, shinobi wrote:
> 
>> Hello All,
>>
>> I'm looking for good C compiler for WIN64.
> 
> Install Cygwin64. It comes with GCC and a vast assortment
> of other compilers, interpreters, and tools. It also gives
> you BASH as your command interpreter (instead of DOS),
> and a linux-like file-access syntax:
> D:\MyDir\MyFile.abc -> /cygdrive/d/MyDir/MyFile.abc
> I do all my programming for system maintenance these days
> in Perl on Cygwin on Windows 10. And I also use C and C++
> on this platform. I also have Ada, Lua, Ruby, and Fortran
> installed, because I can. (I don't actually speak those
> languages, but if I get bored, I may learn.)
> 
> And someone, elsewhere in this thread, mentioned ncurses.
> Well, Cygwin has ncurses available also. I was just playing
> with that yesterday, but having trouble, because I know
> little about ncurses, and the documentation is terse and
> cryptic, so I find it slow learning. But it does present
> some fascinating options for control of input & output.


If the primary reason for Cygwin is to gain access to ncurses (since 
there are perfectly good compilers for Windows that don't need Cygwin) 
then it's the start of a slippery slope.

I tried ncurses a few years ago (I think the Windows version was called 
pdcurses), and I abandoned it as being overkill for what I wanted to do. 
It also introduced some complications.

I can't remember what was involved but the fact that it is now elusive 
to track down the header files and libraries needed (I looked at 
something just now that involved building from source), means I would 
keep away from it.

What is the task that actually needs to be achieved? In my case it was 
random positioning within a console, and being able to use colour text. 
Something that every home computer of the 1980s could do with no fuss.

So why is it suddenly such a big deal? Is Windows really so incapable 
that it needs to import most of Linux for this simple task?

In the end I ended up used WinAPI function calls; not that simple, but 
once done it's done. And with more control over the the console than you 
get with NCURSES, which wants to take it over and forces you to use some 
crappy windowing system that you don't need and don't want.

However, here's an example of cursor positioning: once the WinAPI stuff 
is out of the way, you call initconsole() once, then setpos(column, row) 
for each new position. (column, row are zero-based here but that is 
easily changed.)

The example fills the console with "." characters except for a border of 
'X'. The bottom row is not included to prevent scrolling.

------------------------------------------------------------------------------

#include <stdio.h>
#include <windows.h>

HANDLE hconsole;
int screencols,screenrows;

void initconsole(void) {
   CONSOLE_SCREEN_BUFFER_INFO info;

   hconsole=GetStdHandle(STD_OUTPUT_HANDLE);

   GetConsoleScreenBufferInfo(hconsole, &info);

   screencols=info.dwSize.X;
   screenrows=info.dwSize.Y;
}

void setpos(int col, int row) {
   COORD pos = {col, row};
   SetConsoleCursorPosition(hconsole, pos);
}

int main(void) {
   int i,x,y;

   initconsole();

   for (y=0; y<screenrows-1; ++y) {
	for (x=0; x<screencols; ++x) {
		setpos(x,y);
		if (x==0 || y==0 || x==screencols-1 || y==screenrows-2)
			printf("X");
		else
			printf("-");
	}
   }

   getch();
}

-- 
bartc

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Good C compiler for WIN64 shinobi@f153.n1.z21.fsxnet (shinobi) - 2018-02-07 11:14 +1200
  Re: Good C compiler for WIN64 David Brown <david.brown@hesbynett.no> - 2018-02-07 14:04 +0100
    Re: Good C compiler for WIN64 Keith Thompson <kst-u@mib.org> - 2018-02-07 09:52 -0800
      Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-07 18:24 +0000
    Re: Good C compiler for WIN64 shinobi@f153.n1.z21.fsxnet (shinobi) - 2018-02-07 16:10 +1200
    Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-07 13:48 +0000
      Re: Good C compiler for WIN64 Robert Wessel <robertwessel2@yahoo.com> - 2018-02-08 01:41 -0600
    Re: Good C compiler for WIN64 Robert Wessel <robertwessel2@yahoo.com> - 2018-02-08 01:44 -0600
  Re: Good C compiler for WIN64 Noob <root@127.0.0.1> - 2018-02-07 21:18 +0100
    Re: Good C compiler for WIN64 shinobi@f153.n1.z21.fsxnet (shinobi) - 2018-02-08 08:22 +1200
      Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-08 10:40 +0000
  Re: Good C compiler for WIN64 "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2018-02-08 00:06 +0800
    Re: Good C compiler for WIN64 shinobi@f153.n1.z21.fsxnet (shinobi) - 2018-02-08 08:21 +1200
      Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-08 10:36 +0000
        Re: Good C compiler for WIN64 already5chosen@yahoo.com - 2018-02-08 03:49 -0800
  Re: Good C compiler for WIN64 Robbie Hatley <loneSNIPwolf@wellCUT.com> - 2018-02-08 03:22 -0800
    Re: Good C compiler for WIN64 already5chosen@yahoo.com - 2018-02-08 04:05 -0800
    Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-08 12:32 +0000
      Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-08 12:40 +0000
      Re: Good C compiler for WIN64 David Brown <david.brown@hesbynett.no> - 2018-02-08 14:36 +0100
        Re: Good C compiler for WIN64 Robbie Hatley <loneSNIPwolf@wellCUT.com> - 2018-02-08 09:47 -0800
          Re: Good C compiler for WIN64 already5chosen@yahoo.com - 2018-02-08 10:33 -0800
          Re: Good C compiler for WIN64 David Brown <david.brown@hesbynett.no> - 2018-02-09 10:33 +0100
            Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-09 10:48 +0000
              Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-09 11:18 +0000
              Re: Good C compiler for WIN64 David Brown <david.brown@hesbynett.no> - 2018-02-09 15:24 +0100
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 12:56 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 15:44 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 16:13 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 17:36 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 18:15 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 18:27 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 18:42 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 20:03 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 20:23 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 20:58 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 21:13 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 21:40 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 22:22 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 23:39 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-11 01:07 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-11 01:23 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-11 01:38 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-11 01:42 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-11 10:58 +0000
                Re: Good C compiler for WIN64 Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-02-11 03:17 -0800
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-11 11:33 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-11 14:21 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-11 15:05 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-11 17:08 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-12 22:32 +0000
                Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-10 18:26 +0000
                Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-10 20:02 +0000
                Re: Good C compiler for WIN64 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-02-10 14:45 +0000
                Re: Good C compiler for WIN64 GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-02-10 16:42 +0100
                Re: Good C compiler for WIN64 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-02-11 08:16 +0000
                Re: Good C compiler for WIN64 GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-02-11 13:48 +0100
                Re: Good C compiler for WIN64 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-02-11 15:42 +0000
                Re: Good C compiler for WIN64 GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-02-11 18:44 +0100
                Re: Good C compiler for WIN64 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-02-12 15:39 +0000
                Re: Good C compiler for WIN64 David Brown <david.brown@hesbynett.no> - 2018-02-11 16:26 +0100
              Re: Good C compiler for WIN64 Ian Collins <ian-news@hotmail.com> - 2018-02-10 09:50 +1300
      Re: Good C compiler for WIN64 Thiago Adams <thiago.adams@gmail.com> - 2018-02-08 12:21 -0800
        Re: Good C compiler for WIN64 bartc <bc@freeuk.com> - 2018-02-08 22:52 +0000
          Re: Good C compiler for WIN64 Thiago Adams <thiago.adams@gmail.com> - 2018-02-09 10:01 -0800
  Re: Good C compiler for WIN64 jacobnavia <jacob@jacob.remcomp.fr> - 2018-02-08 20:16 +0100
    Re: Good C compiler for WIN64 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-08 19:58 +0000

csiph-web