gcc and cygwin

Ian Lance Taylor ian@airs.com
Wed May 11 14:41:00 GMT 2005


Marcel <kak343@yahoo.com> writes:

> I've been using a particular set of C-code for years
> on several systems (mostly linux on PC, or Unix on
> some Sun) and could always get it to work when I moved
> to a new machine.
> 
> Now, I'm trying to get it to work on a PC with cygwin.
> 
> cygcheck claims I have gcc version 3.3.3-3 OK.
> 
> I am NOT an experienced C or cygwin user, but the
> problems I keep running into, appear to me that gcc
> with cygwin behaves very differently from whatever I
> had on the previous systems.
> 
> gcc -g -Wall -c flm.c
> flm.c:37: error: initializer element is not constant
> make: *** [flm.o] Error 1
> 
> The offending line.37 was:
> FILE *ch_par=stdout,*ch_verify=NULL;
> 
> In my ignorance, I have to assume that gcc/cygwin is
> not compatible with other cc implementations. Can that
> be? Or could I have a botched installation of
> cygwin+gcc?

This is not a gcc question, so this is not the right mailing list.

You are trying to initialize ch_par to stdout.  You didn't say, but I
would guess that ch_par is a global variable.  In C, you can only
initialize a global variable to a constant.  The C standard does not
require stdout to be a constant, though on some systems it is.
Presumably on cygwin stdout is not a constant.

Ian



More information about the Gcc-help mailing list