Subject: RE: gcc error: ld cannot find user32 (w32api package installed)
From: "Edward M. Lee" <[email-masked]>
To: "'Jeremy Hetzler'" <[email-masked]>
Cc: <[email-masked]>
Date: Tue, 19 Mar 2002 22:42:38 -0500

Try removing the ./ from the w32api-1.2.1.tar.bz2 package, then
reinstall.

Or just tar -C / path/to/w32api-1.2.1.tar.bz2

Cheers,
edward

-----Original Message-----
From: [email-masked] [mailto:[email-masked]] On Behalf
Of Jeremy Hetzler
Sent: Tuesday, March 19, 2002 9:50 PM
To: [email-masked]
Subject: gcc error: ld cannot find user32 (w32api package installed)

Installed packages include cygwin 1.3.10-1, binutils 20011002-1, gcc 
2.95.3-5, and w32api 1.2-1. gcc and cygcheck output follows.

$ cat hello.c
#include <stdio.h>

int main() {
         printf("Hello World!\n");
         return 0;
}

$ gcc -v -o hello hello.c
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
gcc version 2.95.3-5 (cygwin special)
  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cpp0.exe -lang-c -v
-D__GNUC__=2 
-D__GNUC_MINOR__=95 -D_X86_=1 -D_X86_=1 -Asystem(winnt) -Acpu(i386) 
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 
-D__i686__ -D__pentiumpro -D__pentiumpro__ 
-D__stdcall=__attribute__((__stdcall__)) 
-D__cdecl=__attribute__((__cdecl__)) 
-D_stdcall=__attribute__((__stdcall__))
-D_cdecl=__attribute__((__cdecl__)) 
-D__declspec(x)=__attribute__((x)) -D__CYGWIN32__ -D__CYGWIN__ -Dunix 
-D__unix__ -D__unix -isystem /usr/local/include -idirafter /usr/include 
-idirafter /usr/include/w32api hello.c /g/temp/steveb/ccjH6mk2.i
GNU CPP version 2.95.3-5 (cygwin special) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
  /usr/local/include
  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include
  /usr/include
  /usr/include/w32api
End of search list.
The following default directories have been omitted from the search
path:
End of omitted list.
  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cc1.exe 
/g/temp/steveb/ccjH6mk2.i -quiet -dumpbase hello.c -version -o 
/g/temp/steveb/ccg69lz9.s
GNU C version 2.95.3-5 (cygwin special) (i686-pc-cygwin) compiled by GNU
C 
version 2.95.3-5 (cygwin special).
 
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/
as.exe 
-o /g/temp/steveb/ccejfAPc.o /g/temp/steveb/ccg69lz9.s
  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/collect2.exe -Bdynamic 
--dll-search-prefix=cyg -o hello.exe /usr/lib/crt0.o -L/usr/local/lib 
-L/usr/lib -L/usr/lib/w32api -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5 
/g/temp/steveb/ccejfAPc.o -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 
-lshell32 -lgcc
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/
ld: 
cannot find -luser32
collect2: ld returned 1 exit status

$ cygcheck -s -v -r

Cygwin Win95/NT Configuration Diagnostics
Current System Time: Tue Mar 19 21:38:44 2002

Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 2

Path:	d:\cygwin\usr\local\bin
	d:\cygwin\bin
	d:\cygwin\bin
	e:\WINNT\system32
	e:\WINNT
	e:\WINNT\System32\Wbem
	d:\cygwin\bin
	d:\bin
	f:\steveb\scripts\production
	d:\bin\pstools
	d:\programs\perl\bin
	d:\programs\SSH
	d:\programs\mysql\bin
	.

SysDir: E:\WINNT\System32
WinDir: E:\WINNT

HOME = `f:\steveb'
MAKE_MODE = `unix'
PWD = `/home/steveb'
USER = `steveb'

ALLUSERSPROFILE = `E:\Documents and Settings\All Users'
APPDATA = `E:\Documents and Settings\steveb\Application Data'
COMMONPROGRAMFILES = `E:\Program Files\Common Files'
COMPUTERNAME = `NONE'
COMSPEC = `E:\WINNT\system32\cmd.exe'
HOMEDRIVE = `E:'
HOMEPATH = `\'
LESS = `-x4'
LOGDIR = `/home/steveb/log'
LOGONSERVER = `\\NONE'
MANPATH = `:/usr/ssl/man'
NUMBER_OF_PROCESSORS = `1'
OLDPWD = `/home/steveb/src'
OS2LIBPATH = `E:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
PAGER = `/usr/bin/less'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PL'
PERLLIB = `/home/steveb/lib/perl'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 8 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0803'
PROGRAMFILES = `D:\programs'
PS1 = `\[\033]0;\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
SHLVL = `1'
SYSTEMDRIVE = `E:'
SYSTEMROOT = `E:\WINNT'
TEMP = `g:\temp\steveb'
TERM = `cygwin'
USERDOMAIN = `NONE'
USERNAME = `steveb'
USERPROFILE = `E:\Documents and Settings\steveb'
WINDIR = `E:\WINNT'
_ = `/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
   (default) = `/cygdrive'
   cygdrive flags = 0x00000022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Men
uOrder\Start 
Menu\Programs\Cygnus Solutions
   (default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
   (default) = `d:\cygwin'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c
   (default) = `c:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/d
   (default) = `d:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/e
   (default) = `e:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/f
   (default) = `f:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/g
   (default) = `g:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/h
   (default) = `h:'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
   (default) = `d:\cygwin/bin'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
   (default) = `d:\cygwin/lib'
   flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A
c:  hd  NTFS    2502Mb  99% CP CS UN PA FC     hdd0:1 static
d:  hd  NTFS    2015Mb  99% CP CS UN PA FC     hdd0:0:1 programs
e:  hd  NTFS    1498Mb  99% CP CS UN PA FC     hdd0:0:0 system
f:  hd  NTFS    3639Mb  98% CP CS UN PA FC     hdd0:2 dynamic
g:  hd  FAT32   3234Mb  75% CP    UN           HDD1-0 TEMP
h:  cd           N/A    N/A
i:  cd           N/A    N/A

.              /cygdrive  user    binmode,noumount
d:\cygwin      /          system  binmode
c:             /c         system  binmode
d:             /d         system  binmode
e:             /e         system  binmode
f:             /f         system  binmode
g:             /g         system  binmode
h:             /h         system  binmode
d:\cygwin/bin  /usr/bin   system  binmode
d:\cygwin/lib  /usr/lib   system  binmode

Found: d:\cygwin\bin\bash.exe
Found: d:\cygwin\bin\cat.exe
Found: d:\cygwin\bin\cpp.exe
Found: d:\cygwin\bin\find.exe
Found: d:\cygwin\bin\gcc.exe
Found: d:\cygwin\bin\gdb.exe
Found: d:\cygwin\bin\ld.exe
Found: d:\cygwin\bin\ls.exe
Found: d:\cygwin\bin\make.exe
Found: d:\cygwin\bin\sh.exe

    56k 2000/12/03 d:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
                   "cygbz21.0.dll" v0.0 ts=2000/11/20 18:53
   621k 2002/01/16 d:\cygwin\bin\cygcrypto.dll - os=4.0 img=1.0 sys=4.0
                   "cygcrypto.dll" v0.0 ts=2002/1/16 4:54
   107k 2002/03/07 d:\cygwin\bin\cygcurl-2.dll - os=4.0 img=1.0 sys=4.0
                   "cygcurl-2.dll" v0.0 ts=2002/3/7 10:03
    50k 2002/03/17 d:\cygwin\bin\cygexslt-0.dll - os=4.0 img=1.0 sys=4.0
                   "cygexslt-0.dll" v0.0 ts=2002/3/17 1:24
    45k 2001/04/25 d:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                   "cygform5.dll" v0.0 ts=2001/4/25 1:28
    35k 2002/01/09 d:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                   "cygform6.dll" v0.0 ts=2002/1/9 1:03
    19k 2002/02/20 d:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                   "cyggdbm.dll" v0.0 ts=2002/2/19 22:05
    17k 2001/06/28 d:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0
sys=4.0
                   "cyghistory4.dll" v0.0 ts=2001/1/6 23:34
    20k 2002/01/13 d:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0
sys=4.0
                   "cyghistory5.dll" v0.0 ts=2002/1/12 20:27
    22k 2001/12/13 d:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                   "cygintl-1.dll" v0.0 ts=2001/12/13 4:28
    21k 2001/06/20 d:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                   "cygintl.dll" v0.0 ts=2001/6/20 13:09
    81k 2001/10/20 d:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                   "cygitcl30.dll" v0.0 ts=2001/10/19 20:25
    35k 2001/10/20 d:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                   "cygitk30.dll" v0.0 ts=2001/10/19 20:25
    45k 2002/02/08 d:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                   "cygjbig1.dll" v0.0 ts=2002/2/7 18:59
   119k 2002/02/09 d:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                   "cygjpeg6b.dll" v0.0 ts=2002/2/9 0:19
    35k 2002/02/04 d:\cygwin\bin\cygltdl-3.dll - os=4.0 img=1.0 sys=4.0
                   "cygltdl-3.dll" v0.0 ts=2002/2/3 20:56
    26k 2001/04/25 d:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                   "cygmenu5.dll" v0.0 ts=2001/4/25 1:27
    20k 2002/01/09 d:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                   "cygmenu6.dll" v0.0 ts=2002/1/9 1:03
   156k 2001/04/25 d:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0
sys=4.0
                   "cygncurses++5.dll" v0.0 ts=2001/4/25 1:29
   175k 2002/01/09 d:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0
sys=4.0
                   "cygncurses++6.dll" v0.0 ts=2002/1/9 1:03
   226k 2001/04/25 d:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0
sys=4.0
                   "cygncurses5.dll" v0.0 ts=2001/4/25 1:17
   202k 2002/01/09 d:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0
sys=4.0
                   "cygncurses6.dll" v0.0 ts=2002/1/9 1:03
    15k 2001/04/25 d:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                   "cygpanel5.dll" v0.0 ts=2001/4/25 1:27
    12k 2002/01/09 d:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                   "cygpanel6.dll" v0.0 ts=2002/1/9 1:03
    40k 2001/11/21 d:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                   "cygpcre.dll" v0.0 ts=2001/11/21 17:15
    39k 2001/11/21 d:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0
sys=4.0
                   "cygpcreposix.dll" v0.0 ts=2001/11/21 17:15
   170k 2002/01/21 d:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                   "cygpng2.dll" v0.0 ts=2002/1/20 20:05
   108k 2001/06/28 d:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0
sys=4.0
                   "cygreadline4.dll" v0.0 ts=2001/1/6 23:34
   121k 2002/01/13 d:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0
sys=4.0
                   "cygreadline5.dll" v0.0 ts=2002/1/12 20:27
   156k 2002/01/16 d:\cygwin\bin\cygssl.dll - os=4.0 img=1.0 sys=4.0
                   "cygssl.dll" v0.0 ts=2002/1/16 4:54
   390k 2001/10/20 d:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                   "cygtcl80.dll" v0.0 ts=2001/10/19 20:24
     5k 2001/10/20 d:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0
sys=4.0
    10k 2001/10/20 d:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0
sys=4.0
                   "cygtclreg80.dll" v0.0 ts=2001/10/19 20:24
   253k 2002/02/10 d:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                   "cygtiff3.dll" v0.0 ts=2002/2/10 3:34
   623k 2001/10/20 d:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                   "cygtk80.dll" v0.0 ts=2001/10/19 20:25
  1248k 2002/03/17 d:\cygwin\bin\cygxml2-2.dll - os=4.0 img=1.0 sys=4.0
                   "cygxml2-2.dll" v0.0 ts=2002/3/16 22:45
    41k 2002/01/20 d:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0
sys=4.0
                   "cygXpm-noX4.dll" v0.0 ts=2002/1/20 13:49
    46k 2002/01/20 d:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
                   "cygXpm-X4.dll" v0.0 ts=2002/1/20 13:50
   152k 2002/03/17 d:\cygwin\bin\cygxslt-1.dll - os=4.0 img=1.0 sys=4.0
                   "cygxslt-1.dll" v0.0 ts=2002/3/17 1:19
    15k 2002/03/17 d:\cygwin\bin\cygxsltbreakpoint-1.dll - os=4.0
img=1.0 
sys=4.0
                   "cygxsltbreakpoint-1.dll" v0.0 ts=2002/3/17 1:24
    50k 2002/03/12 d:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                   "cygz.dll" v0.0 ts=2002/3/11 23:38
   751k 2002/02/25 d:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                   "cygwin1.dll" v0.0 ts=2002/2/25 11:14
     Cygwin DLL version info:
         DLL version: 1.3.10
         DLL epoch: 19
         DLL bad signal mask: 19005
         DLL old termios: 5
         DLL malloc env: 28
         API major: 0
         API minor: 51
         Shared data: 3
         DLL identifier: cygwin1
         Mount registry: 2
         Cygnus registry name: Cygnus Solutions
         Cygwin registry name: Cygwin
         Program options name: Program Options
         Cygwin mount registry name: mounts v2
         Cygdrive flags: cygdrive flags
         Cygdrive prefix: cygdrive prefix
         Cygdrive default prefix:
         Build date: Mon Feb 25 11:14:34 EST 2002
         Shared id: cygwin1S3

Cygwin Package Information
Last downloaded files to: F:\incoming\cygwin
Last downloaded files from: http://mirrors.rcn.net/pub/sourceware/cygwin

Package             Version
ash                 20020131-1
autoconf            2.53-1
autoconf-devel      2.52-4
autoconf-stable     2.13-4
automake            1.6a-1
automake-devel      1.5-5
automake-stable     1.4p5-5
bash                2.05a-3
binutils            20011002-1
bison               1.33-1
byacc               1.9-1
bzip2               1.0.1-6
clear               1.0
cpio                2.4.2
cron                3.0.1-6
crypt               1.0-1
ctags               5.2-1
curl                7.9.5-1
cvs                 1.11.0-1
cygutils            1.0.0-1
cygwin              1.3.10-1
dejagnu             20010117-1
diff                0.0
expect              20010117-1
file                3.37-1
fileutils           4.1-1
findutils           4.1
flex                2.5.4-1
gawk                3.0.4-1
gcc                 2.95.3-5
gdb                 20010428-3
gdbm                1.8.0-4
gettext             0.10.40-1
gperf               0.0
grep                2.5g
groff               1.17.2-1
gzip                1.3.2-1
indent              2.2.7-2
inetutils           1.3.2-17
irc                 20010101-1
jbigkit             1.2-6
jpeg                6b-7
less                358-3
libintl             0.10.38-3
libintl1            0.10.40-1
libncurses5         5.2-1
libncurses6         5.2-8
libpng              1.0.12-1
libpng2             1.0.12-1
libreadline4        4.1-2
libreadline5        4.2a-1
libtool             20020202a-1
libtool-devel       20020202-1
libtool-stable      1.4.2-2
libxml2             2.4.17-1
libxslt             1.0.13-1
login               1.4-3
lynx                2.8.4-1
m4                  0.0
make                3.79.1-5
man                 1.5g-2
mingw-runtime       1.2-1
mktemp              1.4-1
mt                  2.0.1-1
ncftp               3.1.2-1
ncurses             5.2-8
newlib-man          20001118-1
opengl              1.1.0-5
openssl             0.9.6c-3
openssl-devel       0.9.6c-2
patch               2.5-3
pcre                3.7-1
perl                5.6.1-2
pkgconfig           0.10.0-1
popt                1.6.2-1
rcs                 5.7-2
readline            4.2a-1
regex               4.4
rxvt                2.7.2-10
sed                 3.02-1
sh-utils            2.0-2
squid               2.4-STABLE20010508
ssmtp               2.38.7-3
tar                 1.13.19-1
tcltk               20001125-1
tcsh                6.11.00-4
termcap             20010825-1
terminfo            5.2-1
tetex-beta          20001218-1
texinfo             4.0-5
textutils           2.0.21-1
tiff                3.5.7-1
time                1.7-1
unzip               5.41-1
vim                 6.0.93-1
w32api              1.2-1
wget                1.8.1-1
which               1.5-1
whois               4.5.17-1
xpm-nox             4.2.0-1
zip                 2.3-1
zlib                1.1.4-1

Use -h to see help about each section

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/