develooper Front page | perl.perl5.porters | Postings from July 2001

[ID 20010731.105] MinGW can't compile win32.c on Windows 2000

Thread Next
John Kristian
July 31, 2001 20:47
[ID 20010731.105] MinGW can't compile win32.c on Windows 2000
Message ID:
This is a bug report for perl from,
generated with the help of perlbug 1.33 running under perl v5.6.1.

To build Perl using MinGW-1.0.1-20010726,  I found it necessary to
change win32.c, as follows (from `diff -u`):

--- Perl-5.6.1/win32/win32.c    Sat Mar 03 20:53:19 2001
+++ Perl-5.6.1-MinGW/win32/win32.c Mon Jul 30 22:40:17 2001
@@ -1627,7 +1627,7 @@
        char *arch;

-#if (defined(__BORLANDC__)&&(__BORLANDC__<=0x520)) || defined(__MINGW32__)
+#if (defined(__BORLANDC__)&&(__BORLANDC__<=0x520))
        switch (info.u.s.wProcessorArchitecture) {
        switch (info.wProcessorArchitecture) {
@@ -2047,7 +2047,7 @@
 DllExport char *
 win32_strerror(int e)
-#ifndef __BORLANDC__           /* Borland intolerance */
+#if ! (defined(__BORLANDC__) || defined(__MINGW32__)) /* Borland intolerance */
     extern int sys_nerr;
     DWORD source = 0;
@@ -2501,7 +2501,7 @@
     StreamId.dwStreamId = BACKUP_LINK;
     StreamId.dwStreamAttributes = 0;
     StreamId.dwStreamNameSize = 0;
-#if defined(__BORLANDC__) || defined(__MINGW32__)
+#if defined(__BORLANDC__)
     StreamId.Size.u.HighPart = 0;
     StreamId.Size.u.LowPart = dwLen;

Without these changes, compilation fails with one of the following errors:

gcc -c -I..\lib\CORE -I.\include -I. -I.. -DWIN32  -DPERLDLL -DPERL_CORE -g -O2 -o.\mini\win32.o win32.c
win32.c: In function `win32_uname':
win32.c:1631: structure has no member named `u'
win32.c:1636: warning: unreachable code at beginning of switch statement
win32.c: In function `Nt4CreateHardLinkW':
win32.c:2486: warning: initialization from incompatible pointer type
win32.c:2505: union has no member named `u'
win32.c:2506: union has no member named `u'
win32.c: In function `win32_link':
win32.c:2537: warning: assignment from incompatible pointer type
win32.c: In function `w32_DomainName':
win32.c:3675: warning: assignment from incompatible pointer type
win32.c:3677: warning: assignment from incompatible pointer type
win32.c:3695: warning: passing arg 2 of `WideCharToMultiByte' makes integer from pointer without a cast
win32.c:3699: warning: passing arg 2 of `WideCharToMultiByte' makes integer from pointer without a cast
dmake.exe:  Error code 1, while making '.\mini\win32.o'

 D:\bin\MinGW-1.0.1\bin\..\lib\gcc-lib\mingw32\2.95.3-5\..\..\..\..\mingw32\bin\ld.exe --subsystem console -Bdynamic -o
D:/bin/MinGW-1.0.1/bin/../lib/gcc-lib/mingw32/2.95.3-5/../../../crt2.o -Lc:\perl\5.6.1\lib\MSWin32-x86\CORE -Lc:\gcc-2.95.2-msvcrt\l
ib -LD:/bin/MinGW-1.0.1/bin/../lib/gcc-lib/mingw32/2.95.3-5 -LD:/bin/MinGW-1.0.1/bin/../lib/gcc-lib -LD:/bin/MinGW-1.0.1/bin/../lib/
gcc-lib/mingw32/2.95.3-5/../../../../mingw32/lib -LD:/bin/MinGW-1.0.1/bin/../lib/gcc-lib/mingw32/2.95.3-5/../../..
d:\tmp\mk000001 -lmingw32 -lgcc -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmsvcrt
.\mini\win32.o: In function `win32_strerror':
file://D/bin/Installers/Perl-5.6.1/win32/win32.c:2055: undefined reference to `_sys_nerr'
dmake.exe:  Error code 1, while making '..\miniperl.exe'

[Please do not change anything below this line]
Site configuration information for perl v5.6.1:

Configured by John M. Kristian at Mon Jul 30 22:51:03 2001.

Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    cc='gcc', ccflags ='-g -O2 -DWIN32  -fno-strict-aliasing -DPERL_MSVCRT_READFIX',
    optimize='-g -O2',
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L"D:\bin\Perl\5.6.1\lib\CORE" -L"D:\bin\MinGW-1.0.1\lib"'

libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luui
d -lwsock32 -lmpr -lwinmm -lversion -lodbc32

perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -
luuid -lwsock32 -lmpr -lwinmm -lversion -lodbc32
    libc=-lmsvcrt, so=dll, useshrplib=yes, libperl=libperl56.a
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll  -L"D:\bin\Perl\5.6.1\lib\CORE" -L"D:\bin\MinGW-1.0.1\lib"'

Locally applied patches:

@INC for perl v5.6.1:

Environment for perl v5.6.1:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

n;C:\Program Files\Perforce;T:\tools\bin;D:\jkristian\bin\MSWin32;D:\jkristian\bin\common
    PERL_BADLANG (unset)
    SHELL (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About