From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters) Subject: RE: API's that certainly do work. [was; Re: Windows API calls that don't work? (Was RE: Stupid stupid question :/) 27 Mar 1997 01:59:43 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BC39EE.1D621C60.cygnus.gnu-win32@gbird0> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Original-To: "'GNU-Win32'" Original-Sender: owner-gnu-win32 AT cygnus DOT com Jim Balter[SMTP:jqb AT netcom DOT com] wrote: >A. Phillip Smith wrote: >> I would prefer to think that the other Smith didn't try to link >> with the -lkernel32 library. In which case, things probably did >> work for him. If he ever is inclined to repeat the test with that >> library, I'm sure he'll agree that this is not a figment of our >> collective imaginations, and we can end this thread. > >That may not be enough; if I understood Colin Peters correctly, he tried >your example under win95 and it worked. I would love to try it and >put this (and brain-damaged DRS) to rest, but I don't have gnu-win32 >installed under win95. In hopes of helping you end all this I'll come in and point out that the example was compiled under Mingw32. However, that's not why my attempt worked. Mine worked because the -lkernel32 on the command line problem is a "known problem" for Mingw32 (listed on the web page). I simply wasn't aware that it also happened to Cygwin32 users. The fact that it does pleases me in a perverse way, because it means it's not just my problem. To summarize: The GNU-Win32 version of ld appears to have problems if you link libkernel32 explicitly (e.g. by putting -lkernel32 on the gcc command line). This may cause the executable to mysteriously fail under Cygwin32 or produce a GP fault under Mingw32 (the difference is that Mingw32 doesn't install it's own exception handler). These problems may appear or disappear depending on whether certain functions (or numbers of functions?) are linked from the Win32 API (possibly from kernel32?). To summarize the summary: Don't link with -lkernel32 on your command line. Problem not solved, but at least there's a workaround. Colin. -- Colin Peters - colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp -- Saga University Dept. of Information Science -- http://www.fu.is.saga-u.ac.jp/~colin/index.html -- http://www.geocities.com/Tokyo/Towers/6162/ - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".