Building on Cygwin

Discussion in 'Perl Misc' started by Nigel, Apr 17, 2014.

  1. Nigel

    Nigel Guest

    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
     
    Nigel, Apr 17, 2014
    #1
    1. Advertising

  2. Nigel

    Peter Gordon Guest

    Nigel <> wrote in
    news::

    > 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)
     
    Peter Gordon, Apr 17, 2014
    #2
    1. Advertising

  3. Nigel <> writes:
    > 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.
     
    Rainer Weikusat, Apr 18, 2014
    #3
  4. Rainer Weikusat <> writes:

    [...]

    > [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.
     
    Rainer Weikusat, Apr 18, 2014
    #4
  5. (Greg Bacon) writes:
    > In article <>,
    > Rainer Weikusat <> wrote:
    >
    > : Nigel <> writes:
    > :
    > : > 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?
     
    Rainer Weikusat, Apr 27, 2014
    #5
  6. Στις 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.
     
    George Mpouras, Apr 27, 2014
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil Tomson

    Building GHDL on Cygwin

    Phil Tomson, Dec 16, 2004, in forum: VHDL
    Replies:
    1
    Views:
    2,154
    Phil Tomson
    Dec 26, 2004
  2. Replies:
    0
    Views:
    484
  3. Replies:
    0
    Views:
    437
  4. WELCOME to

    , Sep 3, 2003, in forum: Python
    Replies:
    1
    Views:
    528
    Robin Becker
    Sep 5, 2003
  5. Replies:
    0
    Views:
    418
Loading...

Share This Page