Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: "Gerrit P. Haase" Organization: Esse keine toten Tiere To: "Mirko Vogel" , Date: Thu, 13 Sep 2001 02:39:00 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: load-time-linking a cygwin created Dll Reply-to: gp AT familiehaase DOT de Message-ID: <3BA01C44.32509.C02FCED@localhost> In-reply-to: <025501c13bcf$20497a80$37fe0280@is.cs.cmu.edu> X-mailer: Pegasus Mail for Win32 (v3.12cDE) X-Hops: 1 Mirko Vogel schrieb am 2001-09-12, 17:08: >Hello, > >I've got a problem with a Dll, created with cygwin: My program (another Dll) >crashes with exit code 1 without any comment, when I try to load the Dll >implicitly at load-time. With explicite loading (LoadLibrary & >GetProcAdress) it works fine. > >The header file for the Dll is: > >----- > >#ifdef STTK_DLL_EXPORT > #define STKK_DLL_API __declspec(dllexport) >#else > #define STKK_DLL_API __declspec(dllimport) >#endif > >struct translation_data; > >extern "C" STKK_DLL_API translation_data* initialize(const char* filename); >extern "C" STKK_DLL_API void translateAString(translation_data* p, const >char* source, char* dest); >extern "C" STKK_DLL_API void cleanUp(translation_data* p); > >----- > > >The Dll is created via the -shared option, and the functions are exportet >via __declspec(dllexport). To prevent name mangeling problems, they are >declared as extern "C". > >Since cygwin doesn't create an import library, I had to write a .def file to >generate one. This procedure seems quite strange, because the >__declspec(dllexport) stuff is a replacement for using .def files. Am I >wrong? > >I searched the web and the manuals, but it didn't enlighten me (in fact, it >got a little bit darker). Is __declspec the microsoft way of creating Dlls >(and not portable), and I should avoid it? I don't know if you has been here, but it may help to get a little more insight: http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/dll-stuff/ Gerrit -- =^..^= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/