delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/10/18:45:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Alejandro Lopez-Valencia <dradul AT etb DOT net DOT co>
Subject: Re: Creating DLL's for use with MSVC
Date: Wed, 10 Mar 2004 18:43:47 -0500
Organization: Casa de Cuckoo
Lines: 48
Message-ID: <c2o98k$j93$1@sea.gmane.org>
References: <D9B6A11B-7268-11D8-B092-000393C92B12 AT foi DOT se> <c2mv33$u1m$1 AT sea DOT gmane DOT org> <DEA1FE60-7295-11D8-B092-000393C92B12 AT foi DOT se>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
Keywords: No keywords can be a good thing.
X-Gmane-NNTP-Posting-Host: 200.119.69.189
X-Archive: encrypt
Mail-Copies-To: never
X-Newsreader: Do you care?
X-UserAgent: Does it really matter?
X-Newsreader: Forte Agent 2.0/32.646
Reply-To: cygwin AT cygwin DOT com

On Wed, 10 Mar 2004 14:21:41 +0100, Niklas Wallin wrote in
<DEA1FE60-7295-11D8-B092-000393C92B12 AT foi DOT se>:

Hi Niklas,
>
>Thanks for your answer Alejandro, I still can't get it right though.

You are welcome, but this has truly veered into the realms of the
off-topic.

So in order to pull it back on track, let's do a 'Gendankexperiment'
and suppose neither you or I ever mentioned the flag "-mno-cygwin".
Let's suppose instead that you managed to compile Tendra++ and want to
use Cygwin's GNU g++ to create a DLL with an import library that could
be used by the other compiler.

>
>Ok, the .def file then looks like this:
>
>EXPORTS
>     _ZN7MyClass8getValueEv @1
>     _ZN7MyClass8setValueEi @2
>     _ZN7MyClassC1Ev @3
>     _ZN7MyClassC2Ev @4
>     _ZN7MyClassD1Ev @5
>     _ZN7MyClassD2Ev @6

As CGF pointed out earlier, g++ and your other compiler decorate
functions differently, but you could create an exports aliasing table
in the DLL:

"""
LIBRARY mylibrary
DESCRIPTION "Blah, blah."
EXPORTS
	getValueEv = _ZN7MyClass8getValueEv @1
		.
		.
		.
	Ev2        = _ZN7MyClassD2Ev @6
"""

This is GNU binutils' equivalent to private function declarations in
that other win32 compiler.

Now, I can't say this will work for you, but it works for a couple of
things I use everyday...



--
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/

- Raw text -


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