delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/12/20:37:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Gerrit P. Haase" <gp AT familiehaase DOT de>
Organization: Esse keine toten Tiere
To: "Mirko Vogel" <mirko DOT vogel AT gmx DOT de>, <cygwin AT cygwin DOT com>
Date: Thu, 13 Sep 2001 02:39:00 +0200
MIME-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019