Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: sjc AT qx DOT net To: Reiner DOT Suikat AT dlr DOT de CC: cygwin AT sources DOT redhat DOT com Subject: Re: Problems making a dll with c++ Date: Thu, Aug 3 2000 15:59:18 GMT-0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <7736CDBF164B.AAA74C4@mail2.qx.net> Reiner: I am having problems with compiling dlls as well, however, looking at the faq, it says to add an empty main(){} to the dll source. That worked for me and shouldn't affect the functionality of your code. Your question as to why would be better answered by someone else. Steve > >From: "Reiner Suikat" >Date: Thu, 3 Aug 2000 15:52:57 +0200 >To: "Cygwin Mailing Liste" >Subject: Problems making a dll with c++ > >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 > > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com