public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* CygWin - GCC compiler error
@ 2006-07-21 13:49 MariLiza Koukouli
  2006-07-21 14:02 ` Tim Prince
  2006-07-22  5:33 ` Segher Boessenkool
  0 siblings, 2 replies; 9+ messages in thread
From: MariLiza Koukouli @ 2006-07-21 13:49 UTC (permalink / raw)
  To: gcc-help

Hi all,

I am using the CygWin environent, CYGWIN_NT-5.1, i.e.
on Windows XP. I am trying to compile a piece of code
that contains both F77 and C subroutines. G77 works
fine and compiles without problems but GCC complains
about something that means absolutely nothing to me. 

I am using the following version:

Reading specs from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure
--verbose --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc
--enable-nls --without-included-gettext
--enable-version-specific-runtime-libs --without-x
--enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug
--enable-threads=posix --enable-java-gc=boehm
--disable-win32-registry --enable-sjlj-exceptions
--enable-hash-synchronization --enable-libstdcxx-debug
: (reconfigured) 
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using
dmd 0.125)

And the error I get is:
*************************
*** Make in pbio 
*************************
make[1]: Entering directory
`/cygdrive/d/VALIDATION/BUFR/ECMWF/bufr_000310/pbio'
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c blokex.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c pbbufr.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c pbcrex.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c pbgrib.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c pbionum.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c emosnum.F
g77  -fno-second-underscore -I./  -Dlinux
-DUSE_NO_POINTERS -g -fzeros
-DTABLE_PATH=\"/usr/local/lib\" -c pbpseu.F
gcc  -I./  -DTABLE_PATH=\"/usr/local/lib\"  -Dlinux
-DFOPEN64 -c PBGroutines.c
PBGroutines.c:7: error: parse error before "off64_t"
PBGroutines.c:7: warning: data definition has no type
or storage class
In file included from PBGroutines.c:12:
PBGroutines.h:9: error: parse error before "ftello64"
PBGroutines.h:9: warning: data definition has no type
or storage class
PBGroutines.h:28: error: parse error before "off64_t"
PBGroutines.h:28: warning: no semicolon at end of
struct or union
PBGroutines.h:89: error: parse error before '}' token
PBGroutines.h:89: warning: data definition has no type
or storage class
PBGroutines.c:90: error: parse error before '*' token
PBGroutines.c:90: warning: data definition has no type
or storage class
PBGroutines.c:91: error: parse error before '*' token
PBGroutines.c:91: warning: data definition has no type
or storage class
PBGroutines.c: In function `pbgindx':
PBGroutines.c:127: error: parse error before "space"

Does this mean anything to anyone? I think I found a
similar problem people had using C++ but the specific 
compilation option that was proposed doesn't work for
C.

MANY THANKS,
MariLiza




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-21 13:49 CygWin - GCC compiler error MariLiza Koukouli
@ 2006-07-21 14:02 ` Tim Prince
  2006-07-21 14:21   ` MariLiza Koukouli
  2006-07-22  5:33 ` Segher Boessenkool
  1 sibling, 1 reply; 9+ messages in thread
From: Tim Prince @ 2006-07-21 14:02 UTC (permalink / raw)
  To: MariLiza Koukouli; +Cc: gcc-help

MariLiza Koukouli wrote:

> gcc  -I./  -DTABLE_PATH=\"/usr/local/lib\"  -Dlinux
> -DFOPEN64 -c PBGroutines.c
> PBGroutines.c:7: error: parse error before "off64_t"
> PBGroutines.c:7: warning: data definition has no type
> or storage class
> In file included from PBGroutines.c:12:
> PBGroutines.h:9: error: parse error before "ftello64"
> PBGroutines.h:9: warning: data definition has no type
> or storage class
> PBGroutines.h:28: error: parse error before "off64_t"
> PBGroutines.h:28: warning: no semicolon at end of
> struct or union
> PBGroutines.h:89: error: parse error before '}' token
> PBGroutines.h:89: warning: data definition has no type
> or storage class
> PBGroutines.c:90: error: parse error before '*' token
> PBGroutines.c:90: warning: data definition has no type
> or storage class
> PBGroutines.c:91: error: parse error before '*' token
> PBGroutines.c:91: warning: data definition has no type
> or storage class
> PBGroutines.c: In function `pbgindx':
> PBGroutines.c:127: error: parse error before "space"
> 
> Does this mean anything to anyone? 
It's more likely to mean something if you show source code, before and 
after pre-processing.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-21 14:02 ` Tim Prince
@ 2006-07-21 14:21   ` MariLiza Koukouli
  2006-07-21 23:12     ` Sisyphus
  0 siblings, 1 reply; 9+ messages in thread
From: MariLiza Koukouli @ 2006-07-21 14:21 UTC (permalink / raw)
  To: tprince; +Cc: gcc-help

> It's more likely to mean something if you show
> source code, before and 
> after pre-processing.

Hi Tim, 
Unfortunately, I am not at all familiar with the
terminology you just used. I presume that by "source
code" you mean the GCC-core? I didn't install anything
by hand, I downloaded what I needed from
www.cygwin.com/setup.exe. 
Thanks for trying to help, sorry to be a drag,
MariLiza

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-21 14:21   ` MariLiza Koukouli
@ 2006-07-21 23:12     ` Sisyphus
  2006-07-23 11:25       ` MariLiza Koukouli
  0 siblings, 1 reply; 9+ messages in thread
From: Sisyphus @ 2006-07-21 23:12 UTC (permalink / raw)
  To: MariLiza Koukouli; +Cc: gcc-help


----- Original Message ----- 
From: "MariLiza Koukouli"
.
.
> Hi Tim,
> Unfortunately, I am not at all familiar with the
> terminology you just used. I presume that by "source
> code" you mean the GCC-core?

I think he means the 'PBGroutines.c' and 'PBGRoutines.h' code. The first 15
lines of 'PBGroutines.c' and the first 30 lines of 'PBGroutines.h' is
probably good enough.

Messages like "PBGroutines.c:7: error: ..." and "PBGroutines.c:9: error:
..." are telling you that there are (what gcc considers to be) errors in
line 7 of PBGroutines.c and line 9 of PBGroutines.h respectively ...... and
so on .....

Cheers,
Rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-21 13:49 CygWin - GCC compiler error MariLiza Koukouli
  2006-07-21 14:02 ` Tim Prince
@ 2006-07-22  5:33 ` Segher Boessenkool
  2006-07-23 11:30   ` MariLiza Koukouli
  1 sibling, 1 reply; 9+ messages in thread
From: Segher Boessenkool @ 2006-07-22  5:33 UTC (permalink / raw)
  To: MariLiza Koukouli; +Cc: gcc-help

> PBGroutines.c:7: error: parse error before "off64_t"

You need to compile using -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
(and this is not a GCC question, wrong mailinglist; and I'm sure
Google could have told you this, too).


Segher

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-21 23:12     ` Sisyphus
@ 2006-07-23 11:25       ` MariLiza Koukouli
  0 siblings, 0 replies; 9+ messages in thread
From: MariLiza Koukouli @ 2006-07-23 11:25 UTC (permalink / raw)
  To: Sisyphus; +Cc: gcc-help

> I think he means the 'PBGroutines.c' and
> 'PBGRoutines.h' code. The first 15
> lines of 'PBGroutines.c' and the first 30 lines of
> 'PBGroutines.h' is
> probably good enough.
> 
> Messages like "PBGroutines.c:7: error: ..." and
> "PBGroutines.c:9: error:
> ..." are telling you that there are (what gcc
> considers to be) errors in
> line 7 of PBGroutines.c and line 9 of PBGroutines.h
> respectively ...... and
> so on .....

Thanks for replying Rob. I am including the lines from
those two files and I sure hope that you guys can spot
something because the people who are responsible for
this software swear on a stack of bibles that it
compiles and runs in a CygWin environment and then
proceed with giving me no further information about
the possible necessary CygWin/GNU compiler settings.

Cheers,
MariLiza
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FIRST LINES FROM PBGroutines.c:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef linux
# if !defined __off64_t_defined
typedef __off64_t off64_t;
#define __off64_t_defined
#endif
#endif 

#include "PBGroutines.h"

#ifdef gribAPI
long date_to_Julian(long ddate);
long Julian_to_date(long jdate);
#else
long date_to_julian(long ddate);
long julian_to_date(long jdate);
#endif

integer pbginitInput(_fcd filename, fortint
filename_len);
integer pbginitOutput(_fcd filename, fortint
filename_len);
void copyName(_fcd * , _fcd , fortint );

fortint readgrib(FILE * file, unsigned char * buffer,
fortint * prod_len);

void pbgindx(fortint);
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FIRST LINES FROM PBGroutines.h:

#ifndef PBG_ROUTINES_H
#define PBG_ROUTINES_H

#include <stdio.h>
#include <sys/types.h>

#ifdef FOPEN64
#define OFF_T off64_t
extern OFF_T ftello64(FILE *);
#else
#define OFF_T off_t
#endif

#define _fcd char *
#define fortint int
#define integer int
#define bool int

#define MAX_NUMBER_OF_GRIBS 100

typedef struct gribfile {

  FILE *  fp;
  _fcd    fname;
  char readwriteflag;
  integer max;
  integer count;
  OFF_T * offset;
  integer * length;
  integer * parameter;
  integer * level;
  integer * date;
  integer * time;
  integer * timestep;
  integer * localDefinitionNumber;
  integer * type;
  integer * stream;
  integer * repres;
  integer * levtype;
  integer * number;
  integer * vdate;
  integer * vtime;
  integer * tcNumber;
  integer * tcTotal; 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-22  5:33 ` Segher Boessenkool
@ 2006-07-23 11:30   ` MariLiza Koukouli
  2006-07-23 23:43     ` Sisyphus
  0 siblings, 1 reply; 9+ messages in thread
From: MariLiza Koukouli @ 2006-07-23 11:30 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help



--- Segher Boessenkool <segher@kernel.crashing.org>
wrote:

> > PBGroutines.c:7: error: parse error before
> "off64_t"
> 
> You need to compile using -D_LARGEFILE_SOURCE
> -D_LARGEFILE64_SOURCE
> (and this is not a GCC question, wrong mailinglist;
> and I'm sure
> Google could have told you this, too).

Good morning Segher,
Unfortunately Google didn't tell me anything,
sometimes it helps to know what you are looking for to
be able to spot it. I have included the GCC options
but nothing came out of it, same error, see below.
Many thanks
MariLiza

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$ gcc  -I./  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-DTABLE_PATH=\"/usr/local/lib\"  -Dlinux -DFOPEN64 -c
PBGroutines.c
PBGroutines.c:7: error: parse error before "off64_t"
PBGroutines.c:7: warning: data definition has no type
or storage class
In file included from PBGroutines.c:12:
PBGroutines.h:9: error: parse error before "ftello64"
PBGroutines.h:9: warning: data definition has no type
or storage class
PBGroutines.h:28: error: parse error before "off64_t"
PBGroutines.h:28: warning: no semicolon at end of
struct or union
PBGroutines.h:89: error: parse error before '}' token
PBGroutines.h:89: warning: data definition has no type
or storage class
PBGroutines.c:90: error: parse error before '*' token
PBGroutines.c:90: warning: data definition has no type
or storage class
PBGroutines.c:91: error: parse error before '*' token
PBGroutines.c:91: warning: data definition has no type
or storage class
PBGroutines.c: In function `pbgindx':
PBGroutines.c:127: error: parse error before "space"
PBGroutines.c:129: error: `file' undeclared (first use
in this function)
PBGroutines.c:129: error: (Each undeclared identifier
is reported only once
PBGroutines.c:129: error: for each function it appears
in.)
PBGroutines.c:149: error: parse error before
"headerlen"



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-23 11:30   ` MariLiza Koukouli
@ 2006-07-23 23:43     ` Sisyphus
  2006-07-25 13:15       ` MariLiza Koukouli
  0 siblings, 1 reply; 9+ messages in thread
From: Sisyphus @ 2006-07-23 23:43 UTC (permalink / raw)
  To: MariLiza Koukouli, Segher Boessenkool; +Cc: gcc-help


----- Original Message ----- 
From: "MariLiza Koukouli"
.
.
> $ gcc  -I./  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -DTABLE_PATH=\"/usr/local/lib\"  -Dlinux -DFOPEN64 -c

Is it appropriate to be defining "linux" (-Dlinux) and "FOPEN64" (-DFOPEN64)
on Windows XP ? Seems unlikely to me, but I really don't know.

> PBGroutines.c
> PBGroutines.c:7: error: parse error before "off64_t"
> PBGroutines.c:7: warning: data definition has no type

This is telling you that "__off64_t" (and hence "off64_t", also) is not a
recognised data type. That particular typedef gets included only because
"linux" is defined.

> or storage class
> In file included from PBGroutines.c:12:
> PBGroutines.h:9: error: parse error before "ftello64"
> PBGroutines.h:9: warning: data definition has no type
> or storage class

Again, a similar error to the above - one that would not arise if FOPEN64
was not defined. The other errors probably arise as a flow-on effect of
these errors.

If you *do* need to define "linux" and/or "FOPEN64" then you need to find
out why the above types are unknown.

Cheers,
Rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: CygWin - GCC compiler error
  2006-07-23 23:43     ` Sisyphus
@ 2006-07-25 13:15       ` MariLiza Koukouli
  0 siblings, 0 replies; 9+ messages in thread
From: MariLiza Koukouli @ 2006-07-25 13:15 UTC (permalink / raw)
  To: Sisyphus, Segher Boessenkool; +Cc: gcc-help

> If you *do* need to define "linux" and/or "FOPEN64"
> then you need to find
> out why the above types are unknown.

Hi Rob,
Indeed, I do not need those two definitions, they were
in the makefile given to me and I had no reason to
doubt them. The authors of the code and makefiles and
so on claimed that with those settings you could build
and install on any system.
I have excluded them and the library builts now.
Many thanks,
MariLiza

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-07-25 13:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-21 13:49 CygWin - GCC compiler error MariLiza Koukouli
2006-07-21 14:02 ` Tim Prince
2006-07-21 14:21   ` MariLiza Koukouli
2006-07-21 23:12     ` Sisyphus
2006-07-23 11:25       ` MariLiza Koukouli
2006-07-22  5:33 ` Segher Boessenkool
2006-07-23 11:30   ` MariLiza Koukouli
2006-07-23 23:43     ` Sisyphus
2006-07-25 13:15       ` MariLiza Koukouli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).