Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <007f01c30cc6$1255d9e0$f76d86d9@ellixia> From: "Elfyn McBratney" To: "cygwin" , "Joshua Kwan" References: <20030427094538 DOT GA29573 AT triplehelix DOT org> Subject: Re: Creating DLLs doesn't work normally.. Date: Sun, 27 Apr 2003 15:04:21 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 > Hi all, > > A number of the projects which I am actively developing I have been > trying to port to Cygwin. It has mostly gone without errors except when > making shared libraries. For example: > > g++ -lm -lc -Wall -pedantic -ffast-math -g -ggdb -I../../src -I../.. -MD > -MP -MF '.depend' -DPLUGIN_BUILD -shared > -Wl,-soname,static.so -o static.so static.cpp Well for starters any libraries you link in (-l...) should go right at the end of the g++ command line. And on Cygwin the '-soname' linker flag doesn't do anything. Also you don't need to link to -lc on Cygwin, as it's Cygwin (eg. libc == cygwin1.dll). > In file included from static.cpp:10: ../../src/think.h:18:15: warning: anonymous variadic macros were introduced in C99 > /cygdrive/c/DOCUME~1/joshk/LOCALS~1/Temp/cc0Qd530.o(.text+0x7c): In function `module_init': > /home/joshk/think++/plugins/osc/static.cpp:38: undefined reference to `thPlugin::SetDesc(char const*)' > /cygdrive/c/DOCUME~1/joshk/LOCALS~1/Temp/cc0Qd530.o(.text+0x143): In function `module_callback': > /home/joshk/think++/plugins/osc/static.cpp:56: undefined reference to `thNode::SetArg(char const*, float*, int)' > collect2: ld returned 1 exit status > make[3]: *** [static.so] Error 1 > > However, on Linux the build executes without a hitch. I tried making .so > .dll to no effect. This happens with ircd-hybrid too, so I'm wondering > if I am missing something else. I have pored the archives already and > I've not found a solution... Tried taking out -lm because it is already > part of libcygwin. I'm at a total loss. If you remove the '-soname' linker flag, change `-o soname.so' to `-o soname.dll' and move '-lm' to the end, you should be alright. Elfyn -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/