delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/18/16:14:30

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
X-Originating-IP: [198.108.5.3]
From: "C. Throne" <bluemonkey23 AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: g++ and DLL's
Date: Wed, 18 Apr 2001 20:08:09 -0000
Mime-Version: 1.0
Message-ID: <F51pFJkL8cA9JQVs3Cs0000664f@hotmail.com>
X-OriginalArrivalTime: 18 Apr 2001 20:08:09.0072 (UTC) FILETIME=[49AB9700:01C0C843]

Good Afternoon,

I have a DLL that I compiled under Cygwin (the source code was compiled with 
gcc and the library linked with g++).  Any executable that is 
compiled/linked with gcc is able to use this library just fine.  However 
when I try to compile/link with g++ I get a linker error (it can't find the 
data exported by the DLL).  To be more specific, I have a variable called 
foo in my dll which is exported via a .def file.

In my executable file I have:
extern __declspec(dllimport) int foo;
function()
{
  foo = 5;
}

This compiles/links/runs fine with gcc.  But I get a linker error about not 
being able to find foo when compiled with g++.  I ran the test program 
through the g++ preprocessor and it looks like __declspec(dllimport) is 
getting removed by the g++ preprocessor while it is getting turned into 
__attribute__(( dllimport )) with the gcc processor.

Any help on this would be greatly appreciated.

Thanks,
--Craig

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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