delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/03/09:54:48

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: "Reiner Suikat" <Reiner DOT Suikat AT dlr DOT de>
To: "Cygwin Mailing Liste" <cygwin AT sources DOT redhat DOT 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
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 AT 12

/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference
to 'WinMain AT 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 AT 12

Uusr/bin/ld: warning: cannot find entry symbol _mydll_init AT 12; defaulting to
00401000
/usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference
to 'WinMain AT 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 AT sourceware DOT cygnus DOT com

- Raw text -


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