Building on Cygwin

N

Nigel

To date I have been able to build Perl on Cygwin with no problems but on a new machine I have had problems. Any version that I try to build gives error when trying to compile cygwin.c:

nostdio.h:25:14: error: two or more data types in declaration specifiers
#define FILE struct _FILE

Any ideas?

Regards,

-Nigel
 
P

Peter Gordon

To date I have been able to build Perl on Cygwin with no problems but
on a new machine I have had problems. Any version that I try to build
gives error when trying to compile cygwin.c:

nostdio.h:25:14: error: two or more data types in declaration
specifiers
#define FILE struct _FILE

Any ideas?

Regards,

-Nigel
I assume you know that Perl 5.14.2 is included in Cygwin. (It
is not part of the default setup, but if you search for it
during setup, you will get a number of hits)
 
R

Rainer Weikusat

Nigel said:
To date I have been able to build Perl on Cygwin with no problems but
on a new machine I have had problems. Any version that I try to build
gives error when trying to compile cygwin.c:

nostdio.h:25:14: error: two or more data types in declaration specifiers
#define FILE struct _FILE

Any ideas?

NB: This is not really related to Perl.

You could try to run the .c file through the preprocessor, delete all
preprocessing directives from that and try to compile the
result[*]. This should result in the same error message but you'll find
the actual code the compiler couldn't processed on the corresponding
line of the input file.

[*] Simplistic example based on gcc: When trying to compile following .c file,

------
#define printf (1 + 2)

#include <stdio.h>

int main(void)
{
return 0;
}
------

an error message

In file included from a.c:3:
/usr/include/stdio.h:339: error: expected identifier or '(' before numeric constant

is printed. Line 339 of stdio.h is the printf prototype. Applying the
procedure suggested above,

[rw@sable]/tmp#gcc -E a.c >x.c
[rw@sable]/tmp#ed x.c <<TT
g/^#/d
wq
TT
17145
13674
[rw@sable]/tmp#gcc x.c
x.c:418: error: expected identifier or '(' before numeric constant
[rw@sable]/tmp#cat -n x.c | awk '{ if ($1 == 418) print $0; }'
418 extern int (1 + 2) (__const char *__restrict __format, ...);

That's not of much use for this contrived example, but usually helpful
in case of less trivial macro arrangements.
 
R

Rainer Weikusat

[...]
[rw@sable]/tmp#cat -n x.c | awk '{ if ($1 == 418) print $0; }'
418 extern int (1 + 2) (__const char *__restrict __format, ...);

More on topic: While this also qualifies for an 'awkward use of
awk'-award, a nicer way to express this in perl would be

perl -ne '$. == 418 and print' <x.c

or

perl -ne '$. == 418 and print, exit' <x.c

in case the file is large enough that uselessly processing the remainder
ought to be avoided.
 
R

Rainer Weikusat

: > To date I have been able to build Perl on Cygwin with no problems but
: > on a new machine I have had problems. Any version that I try to build
: > gives error when trying to compile cygwin.c:
: >
: > nostdio.h:25:14: error: two or more data types in declaration specifiers
: > #define FILE struct _FILE
: >
: > Any ideas?
:
: NB: This is not really related to Perl.
: You could try to run the .c file through the preprocessor, delete all
: preprocessing directives from that and try to compile the
: result[*]. This should result in the same error message but you'll find
: the actual code the compiler couldn't processed on the corresponding
: line of the input file.

[followed by an in-depth explanated example how to do that]
Questions about building perl are absolutely on-topic here. Put away
your pea shooter, sheriff.

Unless you have something more useful to say, why don't you offload your
eminent wisdom to a parking meter?
 
G

George Mpouras

Στις 17/4/2014 18:21, ο/η Nigel έγÏαψε:
To date I have been able to build Perl on Cygwin with no problems but on a new machine I have had problems. Any version that I try to build gives error when trying to compile cygwin.c:

nostdio.h:25:14: error: two or more data types in declaration specifiers
#define FILE struct _FILE

Any ideas?

Regards,

-Nigel



Op is missing from the thread but anyway.
There is not ANY reason to compile Perl using cygwin because now there
is the strawberry Perl, which includes the gcc and can install any
module from cpan from source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,790
Messages
2,569,637
Members
45,346
Latest member
EstebanCoa

Latest Threads

Top