This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problems making a dll with c++


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" <Reiner.Suikat@dlr.de>
>Date: Thu, 3 Aug 2000 15:52:57 +0200
>To: "Cygwin Mailing Liste" <cygwin@sources.redhat.com>
>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@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
>
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]