Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199909161345.IAA06640@mercury.xraylith.wisc.edu> To: Thomas Kowatsch cc: Cygwin List Subject: Re: automatic relocation problem? (WAS: problem with 3rd party lib) In-Reply-To: Your message of "Thu, 16 Sep 1999 15:46:22 +0200." <37E0F4AE DOT D09C2A76 AT stest DOT ch> Date: Thu, 16 Sep 1999 08:45:20 -0500 From: Mumit Khan Thomas Kowatsch writes: > > > > Before you do anything further, please fix your DLL making process and > > *remove* the erroneous entry point. Never override the entry point for > > any DLL unless you really know what you're doing (and if you do, ignore > > the rest of the paragraph). The way to handle this is to simply supply > > your own DllMain that will be called automatically by the default entry > > point. In your case, just don't use the library supplied one (ie., don't > > provide one and the linker will pick up the one in the library) since > > you don't do anything special. > > I'm not sure what exactly you mean. Is it the --entry in followingcommand? > > dllwrap --export-all --output-def libxx.def --entry DllEntryPoint AT 12 > --implib libxx.a -o libxx.dll > Yes. Please remove that. You shouldn't define an entry point in general, but rather use the default one (which happens to be __cygwin_dll_entry AT 12 in case you're interested). There is a lot of magic that happens that you are preventing by supplying your own. Here's my `advice of the day' for building DLLs -- Use as little custom code as possible, and use runtime defaults whenever possible. The one that always gets people in trouble is the use a custom entry point, which should only be used when you really know what an entry point does (it typically performs quite a few magic tricks, and end result is that it calls a function called DllMain that you can provide to override the default one). Let the runtime defaults do the right thing for the entry point and provide DllMain to do your custom work. This holds for *all* windows32 compilers, commercial and free. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com