This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re[2]: Petzold Example



     Colin,
     
     Thanks for the help!  It works, sorta-kinda!  It's still not finding 
     the correct entry point (the -e option should work now, though), and 
     the .wav file isn't being played; but, hey!, there is a Window on the 
     screen, and it looks the way it should!  The other things are just 
     details.
     
     Thanks again.
     
     /s/
     Pat Bradford
     
     P.S. Just so you won't think me a complete idiot, up until recently, 
     most of my programming time has been spent on real-time embedded 
     systems, where there is NO user interface.  For me, programming for 
     Windows is a whole new world!
     -PB
     
        Respond to:
                gbradfor@redstone.army.mil
                        AND/OR
                p_n_brad@traveller.com


______________________________ Reply Separator _________________________________
Subject: RE: Petzold Example
Author:  Colin Peters <colin@bird.fu.is.saga-u.ac.jp> at Internet
Date:    11/19/97 12:29 PM


>GBradfor wrote:
>>    the following two-step compile: 
>>     
>>        gcc -c -DSTRICT -o hellowin.obj hellowin.c
>>        ld -o hellowin.exe hellowin.obj --subsystem windows -luser32 
>>                -lgdi32 -L$(GCC_WIN_LIB)
>>     
>>     After copying mmsystem.h down from Microsoft's web, 
>>      Everything compiled and linked.  I do get this warning, 
>>      however:
>>     
>>        ld: warning: cannot find entry symbol WinMainCRTStartup; 
>>        defaulting to 00401000
>>     
>>     Using the "-e mainCRTStartup" as suggested in another post 
>>      doesn't help; the linker can't find that symbol, either.
>>     
>>     When I try to run the resulting executable, I get the following 
>>      error message:
>>     
>>        A required .DLL file, j.DLL, was not found.
     
>This message indicates, usually, that the list of DLLs to import is corrupt. 
>And this happens when the dll import list is not properly terminated by
>a little piece of code in crt0.o. (NOTE: crt0.o is also the place where the 
>entry point mainCRTStartup is defined, which is another hint.)
     
>Basically the problem is that you are running ld directly. Generally it is a 
>better idea to let gcc call the linker by running gcc as if it *was* the 
>linker. That way all kinds of default options get set, including the linking 
>of the startup code crt0.o (which you need).
     
>Change this:
>>        ld -o hellowin.exe hellowin.obj --subsystem windows -luser32 
>>                -lgdi32 -L$(GCC_WIN_LIB)
     
    >to:
    >gcc -o hellowin.exe hellowin.o -mwindows
     
>or:
    >gcc -o hellowin.exe hellowin.o -Wl,--subsystem,windows -luser32 -lgdi32
     
>And things should work, or at least your bugs will change :)
     
>Good luck,
>Colin.
     
>-- Colin Peters - Saga Univ. Dept. of Information Science
>-- colin@bird.fu.is.saga-u.ac.jp - finger for PGP public key 
>-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
>-- http://www.geocities.com/Tokyo/Towers/6162/
     

Received: from michp758.redstone.army.mil (136.205.10.78) by
fhssmtp.redstone.army.mil with SMTP
  (IMA Internet Exchange 2.11 Enterprise) id 000002A2; Wed, 19 Nov 97 01:48:33
-0600
Received: from mic14.redstone.army.mil by michp758.redstone.army.mil id aa20915;
          18 Nov 97 21:32 CST
Received: from gbird0 ([133.49.23.250]) by bird.fu.is.saga-u.ac.jp
(8.8.2/3.3W7-bird) with SMTP id MAA25389; Wed, 19 Nov 1997 12:31:25 +0900 (JST)
Received: by gbird0 with Microsoft Mail
	id <01BCF4E6.C584C740@gbird0>; Wed, 19 Nov 1997 12:29:25 +0900
Message-ID: <01BCF4E6.C584C740@gbird0>
From: Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
To: 'GBradfor' <GBradfor@fhssmtp.redstone.army.mil>
Cc: 'GNU-Win32' <gnu-win32@cygnus.com>
Subject: RE: Petzold Example
Date: Wed, 19 Nov 1997 12:29:23 +0900
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]