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: helpful hints to build dlls in Win32 using cygwin (gnu)


Fergus Henderson writes:

>Padmakar Vishnubhatt <padmakar@eng.sun.com> 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:  giac@dalim.de      |
| 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
"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]