Subject: Re: helpful hints to build dlls in Win32 using cygwin (gnu)
From: [email-masked] ("Philippe GIACINTI")

1 Aug 1997 06:52:46 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]> 
	<[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In-Reply-To: Fergus Henderson <[email-masked]>
        "Re: helpful hints to build dlls in Win32 using cygwin (gnu)" (Aug  1,  2:56pm)
X-Face: ^cJc2\tiS@#Ja@7laz+N]T)kL{-Kay)Oz"?}p[wuY#}}dO"enP!QVO{,}&4P2V[hEfJD]9&
              E1ou~|tY/|9d&7c,7yf>7n: Zj8FD(LtPXWHzy^OJIDi/~O~R]3x/5}"7P;|,*%f:3Z!>h8Ff/&)g?/
              }$RXQ
X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail)
Original-To: [email-masked]
Original-Sender: [email-masked]

Fergus Henderson writes:

>Padmakar Vishnubhatt <[email-masked]> writes:
>
>>I did exactly as u recommended in your hints - and yet I get the
>>following error when I run the linker (ld).  Am I missing something in
>>the cygwin distribution?
>>
>>/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib/libcygwin.a(libccrt0.o)(.text+0x
>>8a):libccrt0.cc: undefined reference to `GetModuleHandleA@4'
>
>Your problem is due to `_impure_ptr'.  (By the way, to debug these
>sorts of problems, use the `-Map' and `--cref' options to `ld'.)
>libccrt0.o should not be linked in to DLLs at all.
>The reason that it does get linked in is because it defines `_impure_ptr',
>which is referenced by your code (implicitly, e.g. because stdout
>is #defined as `_impure_ptr._stdout'), and which is
>not defined anywhere else.
>
>You need to provide a definition of `_impure_ptr'.
>You also need to initialize it (otherwise references to stdout
>etc. in your DLL will be bogus).
>

The problem of definition and initialization of _impure_ptr is solved in my
previous patch.
If you use this patch you must link your dll with libccrt0.o and then you have
to add -lkernel32 to your link line ...

regards.

-- 

 ==========================================================================
|                         Philippe GIACINTI                                |
|                                                                          |
| DALiM GmbH R&D                                email:  [email-masked]      |
| Daimler Strasse 2,                            tel:    +49.7851.9196-28   |
| D-77694 Kehl-Sundheim Germany                 fax:    +49.7851.73576	   |
|                                                                          |
 ==========================================================================
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".