Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Subject: Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++? From: Max Kaehn To: cygwin AT cygwin DOT com In-Reply-To: <200507112314.j6BNEgp0014484@lymeon.ucdavis.edu> References: <200507112314 DOT j6BNEgp0014484 AT lymeon DOT ucdavis DOT edu> Content-Type: text/plain Date: Mon, 11 Jul 2005 16:22:43 -0700 Message-Id: <1121124163.9285.20.camel@fulgurite> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On Mon, 2005-07-11 at 16:14 -0700, Yu-Cheng Chou wrote: > I used "cl -c main.c" and "cl /o main.exe main.obj" to create main.exe. > I used "gcc -shared -o module.dll module.c" to create module.dll. > module.dll will be invoked in main.exe. However, when I run main.exe, the > program just hung there. > So, my question is in an executable program that was created by MSVC, how > to dynamically load a library (module.dll) that was created by cygwin's > gcc? If you don't need cygwin functionality, you can just use MinGW http://www.mingw.org/ and "gcc -mno-cygwin". > Some users suggested that I load cygwin1.dll before module.dll because > module.dll might be related to cygwin1.dll. > module.dll will only be created by cygwin's gcc, but I'm not sure if I did > it in the correct way using "gcc -shared -o module.dll module.c". You may need to arrange that the symbols are exported; do a "dumpbin /exports module.dll" and make sure that those things are available. If your module.dll expects cygwin1.dll to already be present and initialized, you'll need to arrange for 4K at the bottom of your stack, then load cygwin1.dll and call cygwin_dll_init(), then load module.dll. To separate out problems with DLL creation from problems with loading cygwin, create a cygwin loader application for your DLL first, then once you have the bugs ironed out of that, create the non-cygwin version of the loader. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/