Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: "Reiner Suikat" <Reiner.Suikat@dlr.de>
To: "Cygwin Mailing Liste" <cygwin@sources.redhat.com>
Subject: Problems making a dll with c++
Date: Thu, 3 Aug 2000 15:52:57 +0200
Message-ID: <HKEGJFNICJKAMIILDOFCKEIHCAAA.Reiner.Suikat@dlr.de>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700

Hello,

I'm trying to port some big pieces of software to Cygwin, so we can run it
on a Windows 200 machine. This involves building several dlls from C++ code.
And there I'm running into trouble. I tried the commands given in the User
Manual, and I'm getting the following:
With a simple c-program (mydll.c, basically the code snippet with mydll_init
and a small test function):
the first line from the user manual results in:
$ gcc -s -Wl,--base-file,mydll.base -o mydll.dll
mydll.o -Wl,-e,_mydll_init@12

/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference
to 'WinMain@16'
collect2: ld returned 1 exit status

What is goin on? Why do I need a main in a dll?

Using a just as simple c++ file (basically the same, but now the test
function uses cout and its includein iostream.h):
$ g++ -s -Wl,--base-file,mydll.base -o mydll.dll
mydll.o -Wl,-e,_mydll_init@12

Uusr/bin/ld: warning: cannot find entry symbol _mydll_init@12; defaulting to
00401000
/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference
to 'WinMain@16'
collect2: ld returned 1 exit status
(when I tried gcc instead of g++ it also returned a lot of undefined
references to iostream stuff)

Can anybody tell me what I'm missing or point me to some documentation about
c++-dlls in Cygwin??

Thanks for your help

Reiner Suikat


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

